DrAske
asked on
heap size problem!!
Hi experts ..
how to set the heap size for Apache Ant 1.7.0 ??
how to set the heap size for Apache Ant 1.7.0 ??
ASKER
you mean I have to add ANT_OPTS to enviroment variable??
could you pleas give me the full syntax I should put ??
could you pleas give me the full syntax I should put ??
ASKER
I mean what should I put exactly in the enviroment varaible ?
eg. to set it to 512Mb
ANT_OPS=-Xmx512m
ANT_OPS=-Xmx512m
ANT_OPTS=-Xmx512m
ASKER
Thank you, I'll try it tomorrow morning and I'll send back the result :o)
ASKER
that's doesn't work!!
I've tried to set ANT_OPTS from the command prompt:
set ANT_OPTS = -Xms512m
set ANT_OPTS= -Xmx512m
It has been set successfully, but still get outOfMemory Error !!
What I'm trying to do is writing a JUnit testCase for a method in a class, this method returns the sum of size of 3 ArrayLists in this class, in that method I want to check if the counter == Integer.MAX_VALUE then return Integer.MAX_VALUE!!
To be able to test this method I have to set the three Lists to number of elements it exceeds Integer.MAX_VALUE, so when calling size() method it will return Integer.MAX_VALUE!!
This is the testCase, but It gives me outOfMemory during adding elements to the lists:
public void testCollectionView1Accurac y1() throws Exception {
for (int i = 0; i < Integer.MAX_VALUE / 2+100; ++i){
collection.add(new Character('A'));
}
for(int i = 0; i<Integer.MAX_VALUE/2+100; ++i) {
elementsToAdd.add(new Character('A'));
}
collectionView = new CollectionView(collection, elementsToAdd, null);
assertTrue("size() incorrect.", collectionView.size() == Integer.MAX_VALUE);
}
what should I do??
I've tried to set ANT_OPTS from the command prompt:
set ANT_OPTS = -Xms512m
set ANT_OPTS= -Xmx512m
It has been set successfully, but still get outOfMemory Error !!
What I'm trying to do is writing a JUnit testCase for a method in a class, this method returns the sum of size of 3 ArrayLists in this class, in that method I want to check if the counter == Integer.MAX_VALUE then return Integer.MAX_VALUE!!
To be able to test this method I have to set the three Lists to number of elements it exceeds Integer.MAX_VALUE, so when calling size() method it will return Integer.MAX_VALUE!!
This is the testCase, but It gives me outOfMemory during adding elements to the lists:
public void testCollectionView1Accurac
for (int i = 0; i < Integer.MAX_VALUE / 2+100; ++i){
collection.add(new Character('A'));
}
for(int i = 0; i<Integer.MAX_VALUE/2+100;
elementsToAdd.add(new Character('A'));
}
collectionView = new CollectionView(collection,
assertTrue("size() incorrect.", collectionView.size() == Integer.MAX_VALUE);
}
what should I do??
that requests a lot motre than 512Mb doesn't it?
why does the test need to add so many elements to the collection?
why does the test need to add so many elements to the collection?
ASKER
The class is wrapper for some collections in java, I'm using it as a view so it allows to filter the collection, makes changes on it without affecting the original collection.
>>why does the test need to add so many elements to the collection?
to check if size() method returns Integer.MAX_VALUE if the sum of the three lists exceeds it!!
in the real-world this wrapper class will hold a large number of records from database, for large systems.
>>why does the test need to add so many elements to the collection?
to check if size() method returns Integer.MAX_VALUE if the sum of the three lists exceeds it!!
in the real-world this wrapper class will hold a large number of records from database, for large systems.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mmm!! I see, so my laptop won't handle it :o)
thank you very much,
I really appreciate your help :o)
regards,
thank you very much,
I really appreciate your help :o)
regards,
http://ant.apache.org/manual/running.html