Debugging a 32bit JVM from 64bit Eclipse [message #527750] |
Fri, 16 April 2010 07:18  |
Eclipse User |
|
|
|
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 #527779 is a reply to message #527767] |
Fri, 16 April 2010 09:00  |
Eclipse User |
|
|
|
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:

Then I configured my debug configuration to use that JDK:

(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).
|
|
|
Powered by
FUDForum. Page generated in 0.03113 seconds