R
Ross
I appear to have some sort of a memory leak. Even though I can't see
where objects are being retained, the memory requirements of my
program seem way out of kilter with what is actually being stored. I
have one method which does 99% of the running, which has a single
array of size 400 of objects, none of which should be very large. But
I have to give the program tens of megabytes of heap space or it
crashes.
I'm calling the System.gc(); method once per loop, just in case
garbage wasn't being collected, but as expected, no
During each loop of the method, I copy the contents of the array into
another (locally declared) array, then swap the arrays. So, I could
have one copy of the array with out of date objects in it, but this
should be wiped next loop through.
Looking at the Runtime methods totalMemory() and freeMemory(), the
amount of memory in usage does go up and down, but eventually I burn
through 120m of head space - shouldn't happen.
Any hints as to what I could look for to see what is taking up so much
space?
where objects are being retained, the memory requirements of my
program seem way out of kilter with what is actually being stored. I
have one method which does 99% of the running, which has a single
array of size 400 of objects, none of which should be very large. But
I have to give the program tens of megabytes of heap space or it
crashes.
I'm calling the System.gc(); method once per loop, just in case
garbage wasn't being collected, but as expected, no
During each loop of the method, I copy the contents of the array into
another (locally declared) array, then swap the arrays. So, I could
have one copy of the array with out of date objects in it, but this
should be wiped next loop through.
Looking at the Runtime methods totalMemory() and freeMemory(), the
amount of memory in usage does go up and down, but eventually I burn
through 120m of head space - shouldn't happen.
Any hints as to what I could look for to see what is taking up so much
space?