tags:

views:

257

answers:

2

Hello;

When my program runs, following error was taken:

Excepiton in theard "AWT -EventQueue -1" java.lang.UnsatisfiedLinkError: program.dll: Not enough storage is avaliable to process this command

[java] at java.lang.ClassLoader$NativeLibrary.load<Native Method>
[java] at java.lang.ClassLoader.loadLibrary0<ClassLoader.java:1751>
[java] at java.lang.ClassLoader.loadLibrary<ClassLoader.java:1647>
[java] at java.lang.Runtime.load0<Runtime.java:769>
[java] at java.lang.System.load<System.java:968>

How can I solve this problem...

Thanks for help..

+1  A: 

This is a message from Windows indicating that you have run out of memory - not your Java heap, but the machine heap. How does the memory look on your machine while you are trying to run your app?

akf
ın my program three java.exe run, these are:java.exe 15.288 Kjava.exe 180.416 Kjava.exe 308.084 K
bircan
are there any non-java of the processes on your system? this error is complaining about total system memory.
akf
Process:39Physical Memory(k)total 2087084avaliable 941976System Cache 1227552Kernel Memory(k)total 200632paged 174960nonpaged 25672total handles 17109Threads 525Process 40Commit Charge(k)total 1008388limit 4025608peak 1595908
bircan
commit charge: 967 M/ 3931 M
bircan
+1  A: 

When native libraries are loaded into the JVM they are mapped into the JVMs address space and any calls they make to allocate memory do so in that address space - therefore in a 32bit world you've got a maximum of 4GB to play with.

Competing for this 4GB is the JVM and it's heap (although I believe there are limits to the heap size other than the address space that a JVM specific).

Anyway, from your comments on @akf's answer it looks like there's plenty of memory.

I'd also consider that the term 'storage' could refer to more than just memory.

From the Javadoc on java.lang.UnsatisfiedLinkError:

Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.

Please explain/confirm:

  • is program.dll on your java.library.path and are you successfully calling other methods on it.
  • what is program.dll and what are you using it for.
Nick Holt
program.dll is 93 MB , that is so big. when i write application for using program.dll,it runs. But when i integrate an other big application, it does not work.How can i solve this problem.
bircan
What do the memory stats look like for the application that works? Are you using the same JVM for both?
Nick Holt
yes i am using samr JVM for both. when i run application.jar that works, CPU:24, Mem Usage:14 124 K
bircan
can i solve this problem by creating new thread in other big application when loading program.dll
bircan
That's weird but if it works it works, cool. Wonder if the DLL does something with thread local, that's the only thing I can think of that might cause that.
Nick Holt