Re: Xcode-users Digest, Vol 3, Issue 718
Re: Xcode-users Digest, Vol 3, Issue 718
- Subject: Re: Xcode-users Digest, Vol 3, Issue 718
- From: Greg Guerin <email@hidden>
- Date: Thu, 2 Nov 2006 17:31:44 -0700
Paul Archibald wrote:
>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.
Might be both.
The different JVM versions and architectures have different upper limits.
I vaguely recall something like 1600 MB for a recent x86-based case.
Search Java-Dev archives, maybe less than 6 mos ago.
As I recall, the way someone found this upper limit was by writing a shell
script that ran the number up until a simple 'java' command failed
(detected by its exit status).
Any memory allocated by JNI code does not come from the Java heap, unless
it's memory for a Java object created by JNI code. So a big array of
doubles in a simple malloc'ed block won't affect Java's heap size. It WILL
affect the process's total memory allotment, which indirectly affects the
Java heap (both have to fit in 4GB space), and directly affects what's
swappable. All of which does make tuning the heap size a bit of an art,
because you have to balance heap and "external" mallocs into a single
process's address space.
This is rapidly heading down the off-topic rabbit-hole, so probably best to
take your reply to Java-Dev if you want to continue.
>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.
You almost certainly want to use J2SE 1.4's direct buffers. Any JNI
reference or tutorial that covers the 1.4 additions should cover these. Or
ask on Java-Dev.
>You must pretty much think in Google search keywords!
Some things I know without looking. Some things I know where to look. A
lot of things I don't know or know where to look, but I know how I'd start
looking for them.
This strategy saves my dwindling memory capacity for important things,
like, um... sorry, I've forgotten.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden