> > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
