Hi guys,
I find how to track this
leaking points or to make sure where they are coming from (from
JDBC connections? or generating Many objects ? or your program really needs a big heap memory to run! and there is nothing wrong with the program).
1) to find in which part of code (or
thread) it starts to eat memory use this link to download YourKit java profil:
http://www.yourkit.com/download/index.jsp
(I have tried many software but this is the best: 0) its free! 1) starts outomatically you just need to download it! 2) has a very rich documentation you can have look at:
http://www.yourkit.com/docs/80/help/memory_telemetry.jsp )
2)to make sure if it is from your connections or something else, (if you are using mySQL) download mysql-gui-tool from :
http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0-r17-win32.msi/from/pick?file=Downloads/MySQLGUITools/mysql-gui-tools-5.0-r17-win32.msi&mirror=pick&file=Downloads/MySQLGUITools/mysql-gui-tools-5.0-r17-win32.msi&mirror=pick#mirrors
this will help you to see how many connections you have at the time. what you need is to make a connection to your data base in MSQL ADMINISTRATOR. and then go to server connections. now go to your
IDE and run your Java program. while running you can see how many connections you have in the TREAD tab of your "server connections" in MSQL ADMINISTRATOR.
So if there are normal amount of connections its not JDBC connections which are consuming the memory!
3) If you think nothings wrong with your code and it just nedd more memory there are two ways to change the setting: 1) Command prompt and 2) your IDE. I Killed my self but couldnt do it by command way
.
IDE way is sooo easy
just go to netbeans click right on the project name > properties>run and then in "VM options" text box copy "-Xms32m -Xmx128m" and its done!!
and thats all I experienced!
If any one have any other suggestion is welcomed!