dcsimg
Memory leak in applet
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sruli_Ganor
Posted On:   Tuesday, April 22, 2003 12:08 AM

Hi Java gurus, I have an applet that runs for a long time and its memory grows enourmously. After some tests I found that the problem is with System.out.println(). You can reproduce it yourself simply as follows: public class MemTest extends java.applet.Applet { String longString = "A long string of 250 characters ..."; public void init() { for (int i=0; i <4000; i++) { System.out.println(longString); } } } My applet writes a lot of traces to the Java Console for troubleshooting. Is this a known problem? Is there a solution? The problem occurs on IE and Netscape with Java plugin 1.4, but not   More>>

Hi Java gurus,


I have an applet that runs for a long time and its memory grows enourmously.
After some tests I found that the problem is with System.out.println().
You can reproduce it yourself simply as follows:


			
public class MemTest extends java.applet.Applet {
String longString = "A long string of 250 characters ...";
public void init() {
for (int i=0; i <4000; i++) {
System.out.println(longString);
}
}
}


My applet writes a lot of traces to the Java Console for troubleshooting. Is this a known problem? Is there a solution?



The problem occurs on IE and Netscape with Java plugin 1.4, but not in AppletViewer.



Thanks in advance


Sruli Ganor    <<Less
About | Sitemap | Contact