Kirk: Last time I owned a windows box (I admit, that was quite a while
ago, but it did have XP SP2, which as far as everyone is concerned is
the 'latest'  version of windows still, I believe), when I tried to
turn swap off a whole host of apps stopped working. I then configured
swap to be 50MB in size, and they started working again, but I didn't
notice any significant speedup; instead, some research showed that the
50MB chunk was heavily contested. I then loaded up the old ramdisk
driver to create an all-RAM disk just to satisfy XP's insistence on
swap space, but that dropped the entire kernel down to 16-bit mode or
some such whacky legacy support maneuvre. A year later I downloaded an
XP native driver to create ram disks but never got around to trying
this again.

I'm on OS X now, but I doubt turning off paging is a good idea; even
if I have more than enough RAM to keep all running apps in memory,
swapping unused bits out is still a useful exercise as it frees up RAM
for disk caches. I wonder if the extra effort to write RAM to swap is
more, or less, disk access compared to the # of accesses saved by disk
caches.

On Jan 1, 10:11 pm, kirk <kirk.pepperd...@gmail.com> wrote:
> > A recap of issues with eating as much memory as you want:
>
> > FACT A: OSes manage virtual memory and make it relatively hard for
> > userland apps to meddle and/or inspect this.
>
> > FACT B: There's no way for the JVM to see any difference between an
> > app leaking memory and an app that has a legitimate use for its
> > continued increased memory requirements. Even if we can somehow
> > magically create a garbage collector that can do perfect cleanup in
> > near zero extra time compared to the more heuristic (pretty good but
> > not perfect) approach used by the current garbage collector, that
> > still doesn't allow us to assume that a JVM that wants more memory
> > should really get it.
>
> Actually... I've written about how one should be able to automagicly
> detect memory leaks. Leaked objects are never accessed so if you track
> access, you can find them. I had some discussions with the guy working
> on the G1 collector and while there are some performance issues with
> tracking references, the scheme was workable. While sorting through
> details, a couple of papers came to light that detail similar schemes
> for automatic leak detection. If I can work out the issue with write
> barriers, this is something that could be dropped into OpenJDK.> FACT C: Its 
> possible to do a complete garbage collect, but this takes
> > precious CPU cycles. This is worth it to avoid swapping, but it is a
> > complete waste of time if the host computer has real memory to spare.
> > It's not like unused memory saves power or some such. It's effectively
> > a free resource, if its there.
>
> swap is an archaic optimization where disk is traded to create more
> memory. Out machines now have more memory than one can shake a stick at.
> If you've got 2-4 gigs on your machine, I'd turn swap off. I've done
> this for my windows machines for a couple of years now. They have 2 gigs
> of ram. Occasionally I have to turn swap back on when I'm doing
> something that  requires a lot of ram. However I normally use less than
> 2gigs so turning off swap is no big deal. The performance boost it gives
> is worth it. It also keeps my disk drive quiet which is a blessing for
> the batteries in my laptops.
>
> Regards,
> Kirk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to