Garbage collector: Out of memory (when running AWT/SWING code on arm-linux)

David Daney ddaney@avtrex.com
Fri Jun 6 16:44:00 GMT 2008


Andrew Haley wrote:
> ffileppo wrote:
>>> Hi guys,
>>>
>>> I'm getting the following error:
>>>
>>> GC Warning: Out of Memory! Returning NIL!
>>>
>>> when I try to run any AWT/SWING code compiled with arm-linux-gcj on my embedded box (PXA270 - 128MB Ram). (Other code just runs fine)
>>>
>>> For example this code:
>>>
>>> import javax.swing.*;
>>>
>>> public class SimpleFrame {
>>>   public static void main(String args[]) {
>>>     System.out.println("Check 1");
>>>     JFrame f = new JFrame("Simple Frame");
>>>     System.out.println("Check 2");
>>>     f.setSize(200,100);
>>>     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>>>     f.setVisible(true);
>>>   }
>>> }
>>>
>>> gives out of memory error after printing "Check 1".
>>> Trying with some other code I can see that the first AWT/SWING call causes this error.
>>>
>>> Any idea to fix / debug this problem?
>>>
>>> I've read somewhere to look at stack trace and GC log but I don't know where to get these info.
>>>
>>> I'm using gcc 4.3.0, compiled for arm-linux-gnueabi with GTK AWT peer support.
>>>
>>> When I try to run AWT/SWING code on my embedded box I have like 110Mb of free ram (with Xorg and matchbox or xfce running).
>>>
>>> Thank you,
>>>
>>> Francesco
>>
>> Hi again,
>>
>> I've tried defining GC_PRINT_STATS and GC_DUMP_REGULARLY to get some debug info.
>>
>> However I can't understand what's going wrong (please see my log at end).
>>
>> Any advice? I'm really running out of ideas...
>>
>> Could anyone confirm the faesibility of running a GTK AWT peer application on an embedded system with about 100Mb of free ram?
>>
>> Here is my log:
> 
> Look at this:
> 
> Collection 4 finished ---> heapsize = 64262144 bytes
> 
> That's huge, and it's probably real.
> 
> I'm trying to run your test example on my ARM GNU/Linux box but it won't let me
> log in.  I suspect it's checking its disks.  Later I'll tell you how I get on.
> 
> Andrew.

May I point you to:

http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcj/Invoking-gc_002danalyze.html

We wrote it specifically to shed light on this type of problem.

David Daney



More information about the Java mailing list