Re: Out of memory error

Bruce Boyes <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
At 04:57 PM 2/24/2004 +0100, Erio Magnoni wrote:
>Hi everyone!
>
>I have some problems writing on a file..after some time a
>java.lang.OutOfMemoryError is thrown such as follows:
>
>java.lang.OutOfMemoryError
>      in java.io.OutputStreamWriter.<init><@JPC=110025>
>      in java.io.FileWriter.<init><@JPC=160008>
>      in Misura.Scrivifile<@JPC=a005c>
>      in java.lang.system.???

Add a periodic check of classes java.lang.Runtime -- Runtime.totalMemory() 
and Runtime.freeMemory() and see where you are running out. You can also 
decide to call the System.gc() yourself, althought it should also get 
called automatically as needed.

Bruce


------- WWW.SYSTRONIX.COM ----------
   Real embedded Java and much more
www.jrealtime.com and www.tstik.com
+1-801-534-1017  Salt Lake City, USA 


_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.