Re: Waking up sleeping Java applications
From: Chris Smith (cdsmith_at_twu.net)
Date: 12/05/03
- Next message: Joona I Palaste: "Re: Interested in a 10 question Java Quiz."
- Previous message: Chris Smith: "Re: Waking up sleeping Java applications"
- In reply to: Ben Jessel: "Re: Waking up sleeping Java applications"
- Next in thread: nos: "Re: Waking up sleeping Java applications"
- Reply: nos: "Re: Waking up sleeping Java applications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 5 Dec 2003 07:56:36 -0700
Ben Jessel wrote:
> I would hazard a guess that windows always pages it out of memory when
> you minimize it.
That seems to be common knowledge... At the very least, it
substantially reduces the working set size for the process, causing much
of the process to be swapped out to disk.
> However, the reason that C++ ms programs etc dont
> have this problem is that they don't have virtual machine code and
> state to restore.
I doubt that's really an issue, actually. The larger virtual machine
subsystems, like the JIT compiler, are unlikely to be needed when
returning to a long-running Java application. As I just said in another
response, I suspect it's a degenerate relationship between garbage
collection and Windows memory management.
Another artifact of Windows memory management is that instead of using a
straight LRU policy for paging, Windows tries to be fair; it keeps track
of a "working set size" for any given application, and only very
reluctantly adds memory to that working set size if the application
establishes a pattern of swapping. That's a really bad idea when an
application is running a large garbage collection and is mostly swapped
out. If a substantial portion of memory accesses by the garbage
collector are paging, then gc can take 50 to 100 times longer than it
would if the VM subsystem would cooperate. I suspect the VM subsystem
in Windows is optimized around applications with manual memory
management, and no one ever considered how to avoid a pathological case
with garbage collection.
Nevertheless, I've still never actually seen the described symptoms.
> Also, could it be that the classloader refreshes all the classes once
> an app becomes re-activated?
No. That's definitely not the case.
> I think roedy even suggests himself on his site an idea for a project
> where Java dll's are held in memory to enable faster app startup.
Indeed. Back when I still had some time, a few others and I fleshed out
the idea, and documented our plans at http://chives.sunsite.dk/. Then,
of course, we all got too busy before we could complete the test
implementation. Word on the street is that Sun and Apple are
collaborating on a similar approach, but there's no committed release
schedule.
-- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
- Next message: Joona I Palaste: "Re: Interested in a 10 question Java Quiz."
- Previous message: Chris Smith: "Re: Waking up sleeping Java applications"
- In reply to: Ben Jessel: "Re: Waking up sleeping Java applications"
- Next in thread: nos: "Re: Waking up sleeping Java applications"
- Reply: nos: "Re: Waking up sleeping Java applications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|