This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Eliminating static roots from gcj


I've been doing some experimental work with a version of gcj that
doesn't register static roots in shared libraries.  It's very much not
ready for prime time, being basically a bunch of hacks, but I have
some results.

With Eclipse, this results in a reduction of 78% in the size of the
static root set.  This isn't all positive, because now you have to
heap allocate Class instances, fields, and constant pools, and all
that allocation takes time.  But even though there is more allocation
to do, the memory scanned by the gc is much less.

I measured the gc time from the pojnt at which Eclipse puts up its
boot screen and waits for input.

Before my patch:

Initiating full world-stop collection 32 after 30387904 allocd bytes
--> Marking for collection 32 after 30387904 allocd bytes + 3123032 wasted bytes
Collection 31 finished ---> heapsize = 70578176 bytes
World-stopped marking took 240 msecs
Complete collection took 250 msecs

After my patch:

Increasing heap size by 8388608 after 20303560 allocated bytes
Initiating full world-stop collection 38 after 21783856 allocd bytes
--> Marking for collection 38 after 21783856 allocd bytes + 2 562 632 wasted bytes
Collection 37 finished ---> heapsize = 70598656 bytes
World-stopped marking took 110 msecs
Complete collection took 130 msecs

Quite convincing, IMO.

Andrew.


Before my patches you have

(gdb) p GC_print_static_roots()
>From 0x5007a8 to 0x500a28  (temporary)
>From 0x2aaaaabb00a0 to 0x2aaaaabb0358  (temporary)
>From 0x2aaaacad0000 to 0x2aaaad1f1bd0  (temporary)
>From 0x3f12510bc8 to 0x3f12515368  (temporary)
>From 0x3f0ec02d78 to 0x3f0ec03120  (temporary)
>From 0x2aaaad314000 to 0x2aaaad314588  (temporary)
>From 0x3f0e831340 to 0x3f0e83a0a8  (temporary)
>From 0x3f0ea80dd0 to 0x3f0ea810e8  (temporary)
>From 0x3f0e519bc0 to 0x3f0e51ad48  (temporary)
>From 0x2aaab0835de0 to 0x2aaab0836528  (temporary)
>From 0x2aaab0b61408 to 0x2aaab0b68ba8  (temporary)
>From 0x2aaab10e3148 to 0x2aaab11a8370  (temporary)
>From 0x2aaab1ab6000 to 0x2aaab1b34f50  (temporary)
>From 0x2aaab3879bd0 to 0x2aaab3891f90  (temporary)
>From 0x2aaab39fe760 to 0x2aaab3a16990  (temporary)
>From 0x2aaab4087550 to 0x2aaab4221a18  (temporary)
>From 0x2aaab4d50000 to 0x2aaab50948b0  (temporary)
>From 0x2aaab540e288 to 0x2aaab54ce8b0  (temporary)
>From 0x2aaab5b4fae8 to 0x2aaab5c9aca0  (temporary)
>From 0x2aaab5da0000 to 0x2aaab5da1650  (temporary)
>From 0x2aaab60f9000 to 0x2aaab619da98  (temporary)
>From 0x2aaab62a27a0 to 0x2aaab62a3950  (temporary)
>From 0x2aaab63e4000 to 0x2aaab63f7d00  (temporary)
>From 0x2aaab6d295c8 to 0x2aaab6d29808  (temporary)
>From 0x2aaab6ea07d0 to 0x2aaab6ec1a98  (temporary)
>From 0x2aaab70190e8 to 0x2aaab701c4b0  (temporary)
>From 0x3f1230a000 to 0x3f1231ad98  (temporary)
>From 0x3f14703890 to 0x3f14703d08  (temporary)
>From 0x3f18005000 to 0x3f18005478  (temporary)
>From 0x3f10a17000 to 0x3f10a17b98  (temporary)
>From 0x3f11e8c000 to 0x3f11e91290  (temporary)
>From 0x3f11208020 to 0x3f112088c0  (temporary)
>From 0x3f1103d000 to 0x3f1103fa58  (temporary)
>From 0x3f0f600000 to 0x3f0f606d78  (temporary)
>From 0x3f11c1c000 to 0x3f11c1eb90  (temporary)
>From 0x3f0f840000 to 0x3f0f841e38  (temporary)
>From 0x3f0fe02368 to 0x3f0fe02730  (temporary)
>From 0x3f0f291258 to 0x3f0f292490  (temporary)
>From 0x3f11a4d000 to 0x3f11a4e318  (temporary)
>From 0x3f0fa10000 to 0x3f0fa10c80  (temporary)
>From 0x3f1043b7c8 to 0x3f10442d18  (temporary)
>From 0x3f106083b8 to 0x3f10608838  (temporary)
>From 0x3f10c01838 to 0x3f10c01b88  (temporary)
>From 0x3f10807778 to 0x3f10807c40  (temporary)
>From 0x3f11802818 to 0x3f11802ba8  (temporary)
>From 0x3f11409238 to 0x3f114099e8  (temporary)
>From 0x3f11604488 to 0x3f116047a8  (temporary)
>From 0x3f10e275d0 to 0x3f10e289e8  (temporary)
>From 0x3f1006d138 to 0x3f100717e8  (temporary)
>From 0x3f0ee13a40 to 0x3f0ee13f88  (temporary)
>From 0x3f0f402000 to 0x3f0f4022f0  (temporary)
>From 0x3f0f0044b8 to 0x3f0f004798  (temporary)
>From 0x3f10226000 to 0x3f10226de8  (temporary)
>From 0x3f0fc20020 to 0x3f0fc22020  (temporary)
>From 0x2aaab711ee28 to 0x2aaab711f028  (temporary)
>From 0x2aaab725e1a0 to 0x2aaab7262c00  (temporary)
>From 0x2aaab7373000 to 0x2aaab7373950  (temporary)
>From 0x2aaab764a000 to 0x2aaab76d09b0  (temporary)
>From 0x2aaab77fca50 to 0x2aaab780bfd8  (temporary)
>From 0x2aaab7979000 to 0x2aaab798a810  (temporary)
>From 0x2aaab7a9e318 to 0x2aaab7a9e938  (temporary)
>From 0x2aaab7bd9000 to 0x2aaab7bebc90  (temporary)
>From 0x2aaab954cdc8 to 0x2aaab9c20ed0  (temporary)
>From 0x2aaab9dd7000 to 0x2aaab9e0da90  (temporary)
>From 0x2aaaba08b270 to 0x2aaaba0f9f08  (temporary)
>From 0x2aaaba47c000 to 0x2aaaba539e08  (temporary)
>From 0x2aaaba7d1000 to 0x2aaaba848aa0  (temporary)
>From 0x2aaabb7b0190 to 0x2aaabbaff910  (temporary)
>From 0x2aaabcc93000 to 0x2aaabccac8f8  (temporary)
>From 0x2aaabce83000 to 0x2aaabcec17d0  (temporary)
>From 0x2aaabd0ce208 to 0x2aaabd101580  (temporary)
>From 0x2aaabd2dea50 to 0x2aaabd325d10  (temporary)
>From 0x2aaabd43d198 to 0x2aaabd443e38  (temporary)
>From 0x2aaabd699000 to 0x2aaabd701b90  (temporary)
>From 0x2aaabe111000 to 0x2aaabe136fb0  (temporary)
>From 0x2aaabe2ac310 to 0x2aaabe2d0570  (temporary)
>From 0x2aaabe824000 to 0x2aaabe97a7c8  (temporary)
>From 0x2aaabeadc2b0 to 0x2aaabeaf7758  (temporary)
>From 0x2aaabed15000 to 0x2aaabed1b610  (temporary)
Total size: 34036800

And after:

(gdb) p GC_print_static_roots()
>From 0x2aaaacad0000 to 0x2aaaad1f1bd0  (temporary)
Total size: 7478224



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]