Well, I tried a ridiculous size, to see whether it was working at all, and found just what you describe: the JVM barfs. I am coming to think that I should concentrate on the app's use of memory rather than fooling with the heap size, anyway. We do some stuff I am not proud of. One difficuly is that we use our JNI lib for doing mathematical calculations, and the results of those calculations are passed around as arrays of doubles. Sometimes they are quite large arrays. And, what I hate is that we have to pass these big data structures back from the JNI lib, which means we need to make copies of these things, which is redundant, eh? I don't really know what to do about that.
I will look into your suggestions on virtualizing the arrays.
Just to whine a little >>>
One of our problems is that a lot of programmers have had their way with this codebase, and few of them ever seem to have ever discussed architectural issues. So we have a situation where running one of our mathematical models creates a large amtrix of double in our JNI lib, then makes a copy of that matrix in our Java code, AND creates yet another copy of that data in a HashMap which is used by some code one of the previous programmers wrote! 3 copies of this (potentially huge) dataset. But of course excising the HashMap means rewriting a bunch of working code!
<<< end whine
And, of course, JNI discussions don't belong on the Xcode list. Neither does the JVM memory allocation stuff. I just wondered if it could be done via Xcode project settings, like we used to do with CodeWrrior pre OS X. Apparently not.
Again, thanks for pointing me in a useful direction (or two). You must pretty much think in Google search keywords!
P
Re: OutOfMemoryError in my Java app