LWN.net Logo

Rik van Riel's Talk

Rik van Riel's Talk

Posted Jul 29, 2003 1:55 UTC (Tue) by Webexcess (subscriber, #197)
In reply to: Rik van Riel's Talk by tjc
Parent article: Trip report: the Ottawa Linux Symposium

One thing he talked about was how hard it is to deal with programs that behave badly. An example mentioned was how some Java virtual machines that do garbage collection "at some point in the future" tend to crawl through all available memory object allocation by object allocation. This puts pressure on the memory of other applications that haven't been used recently, like say your mail app. When you try to switch back to that other app you find that it's been completely paged out (chug.. chug.. chug..).

Also the current page table is growing too big, and needs to be replaced. The obvious options include dynamic page table allocation and swapping out page tables. Neither of these options is good - the first imposes a general system-wide slowdown on page allocation, the second could have horrible impact when you swap some page tables in only to realize that you need to swap the pages themselves in too (bad for the elevator).


(Log in to post comments)

Rik van Riel's Talk

Posted Jul 29, 2003 3:08 UTC (Tue) by tjc (subscriber, #137) [Link]

An example mentioned was how some Java virtual machines that do garbage collection "at some point in the future" tend to crawl through all available memory object allocation by object allocation.

Does the JVM walk through it's entire virtual address space, or does it just visit pages that have been marked in some way? The former would be horrible, but I'm not sure the later is possible on most architectures.

Also the current page table is growing too big, and needs to be replaced.

Isn't this tied to the hardware architecture, more or less?

(bad for the elevator)

By "bad for the elevator", you are talking about the disk allocation algorithm?

Someone needs to write a "Kernel Hacking for Dummies" book to help out us application programmers. :-) I've picked up bits and pieces on the net, but some of them are probably assembled in the wrong order. How in the world do you learn this stuff?

Rik van Riel's Talk

Posted Jul 29, 2003 4:19 UTC (Tue) by Webexcess (subscriber, #197) [Link]

Does the JVM walk through it's entire virtual address space, or does it just visit pages that have been marked in some way?

I don't know enough about Java VMs to say. :-|

By "bad for the elevator", you are talking about the disk allocation algorithm?

The elevator code is there to reduce disk seeking by reordering disk operations. Unfortunately, when one operation depends on the preceeding one, it never gets a chance. If your page tables are on disk, then you don't know where on disk the page data you need is until after you've fetched the tables. Ie, paging gets alot slower.

Rik van Riel's Talk

Posted Jul 29, 2003 6:08 UTC (Tue) by walters (subscriber, #7396) [Link]

Does the JVM walk through it's entire virtual address space, or does it just visit pages that have been marked in some way? The former would be horrible, but I'm not sure the later is possible on most architectures.

Neither. Most of them only traverse allocated objects, looking at pointers. But I think what Rik is talking about is that this may end up hitting the majority of pages allocated. See any paper on garbage collection for more information.

Rik van Riel's Talk

Posted Jul 29, 2003 8:49 UTC (Tue) by dancres (guest, #4360) [Link]

I tend to agree but the number of objects traversed at any point is also dependent on the algorithm chosen. Certain types of GC will be far worse in respect of this behaviour than others.

I'd sure be interested in hearing Rik "name and shame" the various VM implementations.

Rik van Riel's Talk

Posted Jul 30, 2003 20:06 UTC (Wed) by stuart2048 (subscriber, #6241) [Link]

For years I have dreamt of a Java environment that, instead of
relying on the OS to blindly manage pages, integrates the paging
system directly into the object heap. So that the Java VM pages
objects, or parts of objects that aren't being used (but are
not quite garbage yet).

Of course I expect some of you will tell me this was implemented
30 years ago in some other language ;-)

RE: Rik van Riel's Talk

Posted Oct 11, 2003 17:32 UTC (Sat) by Zakaelri (guest, #15087) [Link]

Someone needs to write a "Kernel Hacking for Dummies" book to help out us application programmers. :-) I've picked up bits and pieces on the net, but some of them are probably assembled in the wrong order. How in the world do you learn this stuff?

Well, simple google search got me these few links on Kernel Hacking:
http://www.kernelhacking.org/
http://www.linuxchix.org/content/courses/kernel_hacking/
And I could swear there was an O'Reilly book on it too... but I can't find the listing on their site.

I would assume that many of the people who do kernel hacking have been in the field for quite some time, and that they have learned about kernel hacking from either college or a *nix-related job somewhere around the line.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds