Skip to main content

Problem With Memory

3 replies [Last post]
carachi83
Offline
Joined: 2011-02-15
Points: 0

Hello everybody,

I have this problem.

I'm building an java server application like webservice that wait the incoming connection and, after a sql select , reply with a XML.

This application reiceve a lot of connection and after 10 minute it use all ram memory.

I try to destroy class / variable but is not allow in java.

I try to use System.gc() and it optimized a little bit the memory but it is not enoght!!

How can I solve this problem?

Thank you

Bye

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rushantha
Offline
Joined: 2005-01-30
Points: 0

System.gc wont help. As Brad suggest without looking at code its not possible to detect problems. If its not an obvious problem you could try to profile the code.

bwillcott
Offline
Joined: 2007-06-01
Points: 0

Without looking at your code, it is very difficult to know why your program is leaking memory.

However, have a look at these JVM memory and GC switch settings. Don't include the
leading -J part, as this is just for NetBeans to know to pass them onto the JVM.

Brad.

bwillcott
Offline
Joined: 2007-06-01
Points: 0

Sorry, forgot to include link:

http://performance.netbeans.org/howto/jvmswitches/

Brad.