Freeing Java memory at a specific point in time

Posted by Marcus on Stack Overflow See other posts from Stack Overflow or by Marcus
Published on 2010-03-25T15:14:56Z Indexed on 2010/03/25 15:23 UTC
Read the original article Hit count: 178

Filed under:
|
|

Given this code, where we load a lot of data, write it to a file, and then run an exe..

void myMethod() {
    Map stuff = createMap(); //Consumes 250 MB memory
    File file = createFileInput(stuff); //Create input for exe
    runExectuable(file); //Run Windows exe
}

What is the best way to release the memory consumed by stuff prior to running the exe? We don't need this in memory any more as we have dumped the data to a file for input to the exe...

Is the best method to just set stuff = null prior to runExecutable(file)?

© Stack Overflow or respective owner

Related posts about java

Related posts about memory