Discussion Locked

Java Programming

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am currently developing a Java application. During the testing stages I encounter MEMORY LEAKAGES. I do not have any idea of where to look for the possible cause of the Leakage. Any suggestions would be appreciated.

5 replies

by fred smith

Whereever you create an object make sure you later destroy it! Most likely problem!
Check out Javacoffeebreak.com also for some more good help on Java coding.

by shadowtraitor

Memory leaks, and Sun said the garbbage collector and fact that no delete keyword is needed would solve this.

To help with this problem you need to call the java garbbage collector explicitly so that it will get the rid of unused and unreferenced objects in memory. I think the code is System.out.gc or something like that, not really reliable so I personally don't use it but you can check your java documentation for the exact command.
Next problem may be file related, if you have to many files opened at once or too many network connections or sockets opened at once this would also result in the dreaded memory leak. Rule of thumb when open something and your finished using it Close it yourself don't wait on the system to do it cause it will do it in its own sweet time.

That should help you

This discussion is closed to new replies.