I've done apps that use Java2D and cycle through large amounts of memory. We even had one running on a large Sun server with 2G allocated to it and it was stable over the long run. That was with 1.3.1, and things have improved with 1.4.x. I recommend reading some of the documentation found here; http://java.sun.com/docs/hotspot/index.html In general, if you configure the JVM correctly, you shouldn't need to call System.gc() ever. If you still have problems, try something like JProbe or OptiimizeIt to fine the source of your memory problems. If you have references to these strings, those tools can find them!
Best of luck, David Quoting Sven Mielordt <[EMAIL PROTECTED]>: > Dear David, > > thank you for the advice concerning memory mapped files. Though this are > interesting topics, the ideas do not solve my problem. The memory leaks occur > due to extensive formation of strings, arrays of strings and other objects, > but not from file accession. > > The problem is to free the memory occupied by objects that are no longer > needed; obviously, the invocation of System.gc() does not really help. > > Perhaps this problem is hard to solve in Java? I need a mechanism that is > similar to the concept of a C++ destructor or something like > Graphics.dispose() but suited for instances of any class. Doesnt there exist > something stronger then just to rely on the garbage collection? > > Another thing that would help is to overcome the daunting 1GB RAM limit for > java when calling the virtual machine with the Xmx attribute. Is there a > trick to make the whole 2GB RAM available to Java? > > Sorry for repeated questioning, > Sven > > > "Rosenstrauch, David" <[EMAIL PROTECTED]> schrieb am 20.07.04 > 15:31:58: > > > > > > > > > -----Original Message----- > > > From: Sven Mielordt [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, July 20, 2004 9:14 AM > > > To: Rosenstrauch, David > > > Subject: Re: [JAVA2D] memory problems with Java and System.gc() > > > > > > > > > That sounds nice, how can I use them and what Java version is needed? > > > > > > As of JDK1.4, it looks like. > > > > Start with these: > > > > http://www.developer.com/java/other/article.php/1548681 > > http://javaalmanac.com/egs/java.nio/CreateMemMap.html?l=rel > > > > I'm sure you can google up some other references from there. > > > > DR > > > > > ============================================================================== > > This message is for the sole use of the intended recipient. If you > received > > this message in error please delete it and notify us. If this message was > > misdirected, CSFB does not waive any confidentiality or privilege. CSFB > > retains and monitors electronic communications sent through its network. > > Instructions transmitted over this system are not binding on CSFB until > they > > are confirmed by us. Message transmission is not guaranteed to be secure. > > > ============================================================================== > > > > > _______________________________________________________ > WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern > Informationen unter: http://freemail.web.de/?mc=021199 > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > Questions, Problems or Concerns contact [EMAIL PROTECTED] > ______________________________________________________________________ > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
