Author: James Swafford
Date: 15:06:42 11/09/05
Please forgive me for the off-topic post. I have a rather annoying problem that I'm hoping one of you Java guys can help me with. I have a Java/SWING application that works really well, but it consumes SO much memory. Actually, it's a client/server program. The server side runs off almost no memory, but the client side is a beast. It's the SWING libraries. Now, I know that Java, and SWING in particular, have reputations for being memory hogs. BUT- I'm observing some behavior in my application that has me troubled. It never seems to release memory! That is, the memory consumption goes steadily up the longer the application is run. It's as if the garbage collector is never doing any collection. In my research I learned that there are no guarantees about when the garbage collector will reclaim memory from dereferenced objects. It may, in theory anyway, delay the process until the system's resources are below some threshold, then reclaim memory. That being the case, it's understandable that the application would have the appearance of consuming more and more memory with time, IF the system indeed still had plenty of free RAM. However- I'm noticing that it's not reclaiming memory *even when the system is almost out of free memory*. As a result, users are complaining about slow performance when the program has been running for over an hour or so. For a language that is supposed to take the burden of memory management out of the hands of the developer, I'm sure spending a lot of time researching and trying to figure out why I'm running out of system resources. I wonder if any of you Java developers might have some insight? BTW, if it makes any difference at all: my application uses JInternalFrames, all contained within a single JFrame. When an internal frame is closed, I simply do a dispose(). As far as I know, that should make all the objects within that frame eligible for garbage collection since they can't be referenced. Any ideas or insight would be very much appreciated. -- James
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.