hami
hami

Reputation: 443

How does running a java application inside eclipse differ in running it directly?

I am developing a java application, which uses a dll using JNI.

The dll is still under development, so I guess it has some memory problems.

When I run my application, using the Run dialog of eclipse, the application is very unstable and crashes very likely. When I start the same application outside from eclipse, the application runs much more stable. There are still crashes, but significantly less.

And two more questions:

What is the difference when the application is run as Debug?

The memory which the dll allocates is not the memory of the virtual machine. So the parameters which influence the memory of the virtual machine (like -Xmx) do not influence the memory allocation for the dll. Is this statement correct?

Thanks in advance for your responses

Upvotes: 1

Views: 114

Answers (2)

uldall
uldall

Reputation: 2558

Please elaborate on "unstable". Which kinds of errors do you receive?

As suggested by codebox I would also make sure that it is the same version of the JVM running.

You can do this by printing JRE information on startup:

System.out.println("Vendor: " + System.getProperty("java.vendor") + ", Version: " + System.getProperty("java.version"));

To change the JRE version in Eclipse go to: Window -> Preferences -> Java -> Installed JREs

Upvotes: 0

codebox
codebox

Reputation: 20254

This doesn't fully answer your question, but it sounds similar to an issue that I've had when running native code from Java.

If running the app one way seems more stable than another, then its possible that you have more than one JVM installed on your system, and Eclipse is using a different one to the one that gets used from the command line.

Upvotes: 1

Related Questions