gcj: mem leaks & speed.

Rutger Ovidius ovid@mailandnews.com
Wed Feb 4 22:57:00 GMT 2004


On Saturday, January 31, 2004, Hans Boehm wrote:
> [Comments added below.]

> On 2004年1月31日, Rutger Ovidius wrote:

>> Hi,
>>>> I have an app that runs well under java, but when compiled with gcj it
>> seems to leak memory (a gig in a few hours) -- this has been reported
>> by users of the app on linux and windows.
>>>> Are there any tools or methods I can use that would help me track down
>> the cause? I'm finding it difficult since the mem leak isn't in my java
>> code as far as I can tell and java profiling isn't helping me.
> Try defining the environment
> variable GC_PRINT_STATS. This should generate a log on stdout (linux)
> or in gc.log (Windows). The high order bit you're looking for is whether
> the growth is due to the Java heap or memory allocated with the system
> malloc.

Hi,
Am I hoping for one or the other?
I don't know if it is a leak yet, or just very different ways of
handling memory:
I have started my app in both java, and gcj at the same time (on
windowsXP) and let it run for a while (it is an SWT gui..)
After running for a while, the XP Task Manager states:
javaw:
Mem Usage 50,824K
VM_Size: 52,328K
app.exe (compiled with gcj)
Mem Usage 161,844K
VM_Size: 164,376K
From GC_PRINT_STATS:
Grew dl table to 4096 entries
 
Increasing heap size by 3997696 after 5285432 allocated bytes
<cut>
Grew dl table to 32768 entries
<cut>
Grew fo table to 65536 entries
<cut>
--> Marking for collection 156 after 15320216 allocd bytes + 2836024 wasted bytes
Collection 155 finished ---> heapsize = 53583872 bytes
World-stopped marking took 160 msecs
Complete collection took 180 msecs
Increasing heap size by 8388608 after 0 allocated bytes
Grew fo table to 65536 entries
<cut>
--> Marking for collection 271 after 360592 allocd bytes + 12304 wasted bytes
Collection 270 finished ---> heapsize = 120692736 bytes
World-stopped marking took 200 msecs
Complete collection took 240 msecs
...
Initiating full world-stop collection 337 after 41617000 allocd bytes
--> Marking for collection 337 after 41617000 allocd bytes + 41856 wasted bytes
Collection 336 finished ---> heapsize = 154427392 bytes
World-stopped marking took 211 msecs
Complete collection took 231 msecs
...
(I find the "Increasing heap by 8 megs after 0 allocated
bytes" line interesting...)
Is there anything else I can do to track down why the app, when
compiled with gcj, uses twice (or three times, and eventually infinite
I assume) amounts of memory? Are there other special flags for
detailed info from the GC or the contents of the heap? (and is the
heap ever supposed to shrink?)
Regards,
Rutger Ovidius


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /