Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Debugging a 32bit JVM from 64bit Eclipse(WIth JNI involved, for added horror)
Debugging a 32bit JVM from 64bit Eclipse [message #527750] Fri, 16 April 2010 07:18 Go to next message
Eclipse UserFriend
Hi!

My project is a fairly plain J2EE webapp program. It debugs almost fine under my main system JDK, which is jdk1.6.0_18 (x64). This is also the JDK I was running Eclipse under. I'm using Windows 7 x64 and Jetty, integrated into Eclipse, for my container.

However, one part of my project uses JNI to invoke some native C (bleurgh, I know). When I hit that part of my project it keeps throwing errors consistent with it not loading the DLL -- even though Process Monitor shows me it looking right at the file, which I've stuck into Windows\System32 for now. I think this might be because the DLL is a 32-bit one. I'm not clear on if loading 32bit DLLs from a 64bit JVM through JNI is even supposed to work?

So anyway, I tried telling Eclipse to use a 32bit JVM to debug under, mostly to see if that would work. However I get a very weird error message; it refuses to instantiate the JVM with
    Error occurred during initialization of VM
    Could not reserve enough space for object heap

It runs fine under a 64 bit JVM, so I think this might be somewhat misleading; I don't think it can actually be memory starvation. There's plenty of free RAM on my system.

Can anyone shed any light on this?

Thanks in advance.

[Updated on: Fri, 16 April 2010 07:18] by Moderator

Re: Debugging a 32bit JVM from 64bit Eclipse [message #527767 is a reply to message #527750] Fri, 16 April 2010 08:18 Go to previous messageGo to next message
Eclipse UserFriend
You can only load a 32 bit DLL into a 32 bit JVM.

That being said, if your 32 bit JVM runs from the command line, it
should run when launched from within eclipse. Did you add the 32 bit
JVM to the Installed JREs and then tell the launch config to use the 32
bit JVM?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: Debugging a 32bit JVM from 64bit Eclipse [message #527779 is a reply to message #527767] Fri, 16 April 2010 09:00 Go to previous message
Eclipse UserFriend
Paul Webster wrote on Fri, 16 April 2010 08:18
You can only load a 32 bit DLL into a 32 bit JVM.
OK, good to know that's definitely the case.

Quote:
That being said, if your 32 bit JVM runs from the command line, it
should run when launched from within eclipse. Did you add the 32 bit
JVM to the Installed JREs and then tell the launch config to use the 32
bit JVM?
Aye. I added my other JVM under Eclipse Preferences | Java | Installed JREs, giving it the right path:

http://static.fscked.co.uk/installed_jres.PNG

Then I configured my debug configuration to use that JDK:

http://static.fscked.co.uk/debug_settings.PNG

(you can see I've been messing around trying to set the project's default JVM too in that screenshot; I've tried both values in there. Also note the x64 and x86 JVMs I'm using are the same patchlevel; I thought that might be important.)

In that config, it throws the "Could not reserve enough space for object heap" error. If I change that debug setting back to the default, 64bit JVM, then the debug environment starts without problems (until I try and use the JNI linked code, which has a lazy classloader, so barfs at invocation time).
Previous Topic:Alternate API to get Compilation Unit Working copy
Next Topic:Need help with GUIs
Goto Forum:
  


Current Time: Sun Mar 16 06:34:56 EDT 2025

Powered by FUDForum. Page generated in 0.03113 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top