Ever been in a situation where when you try to compile your projects, and all in a sudden, out of memory error occurs. Funny, I have sufficient memory on my pc, but what could have gone wrong? My task manager was showing low memory usage.
This probably could be caused by the heap size memory setting. Most setting, by default, is low. So how do we increase this so call memory? I have been using netBeans and Eclipse IDE for my development. So what I known of is in netBeans and Eclipse only.
Lets say we would like to increase the size to a minimum of 128Mb and maximum 256Mb,
In netBeans,
- Go to projects tab.
- Locate the project you wish to change the heap size, expand it.
- Look for a folder call nbproject.
- In nbproject, open the file called project.property.
- Locate a line in the file called "runmain.jvmargs=".
- Add in parameters. Make it "runmain.jvmargs= -J-Xms128m -J-Xmx256m".
- Save the file and rebuild your classes.
In Eclipse,
- Go to Package Explorer.
- Locate the project you wish to change the heap size, right click it.
- In the menu, find Run As > Run... .
- A new windows will pop up. Go to the Arguments tab.
- In VM Arguments text box, Add in parameters"-Xms128m -Xmx256m".
- Click Apply and rebuild your classes.
1 comment:
Boring leh.... talking about "Matrix Code" again
Post a Comment