Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging a Java bus error



Bill Janssen wrote:

Sure enough, if I run with -Xmx900m, my program runs to completion.

That's nasty. I think what's going on here is that if I specify
-Xmx<SIZE>, Java is mmap'ing or somehow reserving a contiguous block of
<SIZE> bytes for the Java heap, and thereby precluding other parts of
the program from using any of that memory, regardless of how much of it
the Java program is using.

Yes, I think that's exactly what's going on. Your description sounds a lot like one I remember from some time ago about how -Xmx worked. It was posted to the list, but I can't recall when. At least a year ago is my guess, but not sure. I'm pretty sure it was from someone at Apple, but I don't recall who. If it really was that long ago, maybe someone from Apple can confirm this for the current JVMs. In the absence of such confirmation, I'd go with your description as a working theory.


And technically, I don't think it's reserving memory for the heap, I think it's reserving address-space. Not that it matters much in this case.

BTW, you're still running into a bug. If mmap() can't map something in, it should fail gracefully with an Exception or an Error, not suicide the native code with an illegal access triggering a bus error. So you should still report that as a bug to Apple.

  -- GG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.