Freeing Java memory at a specific point in time
- by Marcus
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…