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: "Michael Latta" <email@hidden>
- Date: Thu, 2 Nov 2006 13:06:08 -0800
If you use jdk 1.4 or above think about
using Buffers rather than copying data. You can allocate a buffer where the
bytes are not on the Java heap but in other memory that can be accessed
directly by JNI. This allows you to pass data very efficiently between
JNI and java.
You should probably move this to the java
dev list.
Michael
From:
xcode-users-bounces+lattam=email@hidden
[mailto:xcode-users-bounces+lattam=email@hidden] On Behalf Of Paul Archibald
Sent: Thursday, November 02, 2006
1:01 PM
To: email@hidden
Subject: Re: Xcode-users Digest,
Vol 3, Issue 718
GG -
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!
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!
Re: OutOfMemoryError in my
Java app
|
_______________________________________________
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