March 16th, 2003, 10:02 PM
|
#4 (permalink)
|
| Banned
Join Date: Oct 2001
Posts: 447
|
just curious, but how do you know this is an issue? would be helpful... Quote: |
I'll try and simplify this so that you understand why I'm asking the question...
| You need to free up some memory? Which java does with garbage collecting. Easy in java to create objects, just use "new", but no, "old", "free", "dealloc", "kill"...
There is a system call to gc(), but results will be spotty.
Java garbage collects by 'scope'. Therefore you need to populate your array(s) from file, create your objects, do whatever, then have array(s), go out of scope.
If you populate array(s) in main(), they will be garbage collected when main(), goes out of scope. That appears to be not happening.
Some things to try:
Put the read file, populate array in static(vs instance) function, call from main().
Put the read file, populate array, create objects, in static(vs instance) function, call from main().
get the array creation/use out of main(), so 'scope' not same as main(). get whatever you use for creation/use to got out of scope, let garbage collection handle... |
| |