Ranting about JVM's default memory limits...
OK, I'd like to blow off a little steam about the way Sun's JVM handles
memory by default.
Basically, I don't see any option for "grow memory until the OS runs
out" which the default behavior for every other desktop application that
I personally use.
It's completely impractical to ask the user to set this. And grossly
inconvenient to ask the developer to do it for each and every user,
separately. On my machine, if I guess a max heap size (-Xmn) too small
programs run out of memory for no reason. If I guess a max heap size to
large, then the JVM refuses to start because it can grab all the memory
requested on that system.
Java is the only language that exhibits this highly undesirable feature.
Every other app on my desktop (eg., Firefox or Thunderbird) runs
happily until the OS tells it "You're out of memory" then it takes some
kind of action. This allows the user (and the programmer) to take full
advantage of the installed memory with out having to try to predict
future usage patterns.
Gah, I'm really fuming about this. No wonder no one writes desktop apps
in Java, it's grossly impractical.
In a server environment, I can see that one really wants to limit memory
usage. It's a much more controlled situation, and professionally
managed (hopefully, relatively speaking).
For clients, I can see the need to occasionally specify memory
constraints. But I'd really really like to see Sun make the default to
just use memory until the OS says "No more" and then deal with the
results appropriately.
Any further comments? Have I missed the mother of all memory options
for Sun's JVM somewhere? I'd be happy if I had.
Thanks for listening....