File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JNI----JVM Out of memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JNI----JVM Out of memory" Watch "JNI----JVM Out of memory" New topic
Author

JNI----JVM Out of memory

suneel allareddy
Greenhorn

Joined: Jul 19, 2005
Posts: 1
Dear All,
I am calling one dll function from my Java class Repeatedly in loop,after some time it is giving me JVM out of memory exeption and My application is crashing.
My JNI class having one native function which will take one string as parameter and return one string.My main class i am calling the function repeatdetly.it is working fine some times,some times it is giving following error,can any body explain me why JVM crashes?(On which situations JVM will crash?)

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x77FCB6A3
Function=RtlAllocateHeap+0x9B9
Library=C:\WINNT\system32\ntdll.dll

Current Java thread:
at converter.RevConverterClass.convertIsfocToIScii(Native Method)
at converter.RevConverterClass.convertIsfocToIscii(RevConverterClass.java:68)
at HtmlParserClass.handleText(HtmlParserClass.java:676)
at javax.swing.text.html.parser.DocumentParser.handleText(DocumentParser.java:231)
at javax.swing.text.html.parser.Parser.handleText(Parser.java:308)
at javax.swing.text.html.parser.Parser.startTag(Parser.java:350)
at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1846)
at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1881)
at javax.swing.text.html.parser.Parser.parse(Parser.java:2047)
- locked <0x10937768> (a javax.swing.text.html.parser.DocumentParser)
at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:106)
at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78)
at HtmlParserClass.stratModule(HtmlParserClass.java:976)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:186)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.traverseDirectory(ForwardIndexerModule.java:172)
at ForwardIndexerModule.actionPerformed(ForwardIndexerModule.java:125)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.jav
a:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java
:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:20
1)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Dynamic libraries:
0x00400000 - 0x0040B000 C:\j2sdk1.4.2_05\bin\java.exe
0x77F80000 - 0x77FFC000 C:\WINNT\system32\ntdll.dll
0x7C2D0000 - 0x7C335000 C:\WINNT\system32\ADVAPI32.dll
0x7C570000 - 0x7C623000 C:\WINNT\system32\KERNEL32.dll
0x77D30000 - 0x77DA8000 C:\WINNT\system32\RPCRT4.dll
0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
0x08000000 - 0x08139000 C:\j2sdk1.4.2_05\jre\bin\client\jvm.dll
0x77E10000 - 0x77E79000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.dll
0x77570000 - 0x775A0000 C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000 C:\j2sdk1.4.2_05\jre\bin\hpi.dll
0x007C0000 - 0x007CE000 C:\j2sdk1.4.2_05\jre\bin\verify.dll
0x007D0000 - 0x007E9000 C:\j2sdk1.4.2_05\jre\bin\java.dll
0x007F0000 - 0x007FD000 C:\j2sdk1.4.2_05\jre\bin\zip.dll
0x18270000 - 0x18382000 C:\j2sdk1.4.2_05\jre\bin\awt.dll
0x77800000 - 0x7781E000 C:\WINNT\system32\WINSPOOL.DRV
0x76620000 - 0x76631000 C:\WINNT\system32\MPR.DLL
0x75E60000 - 0x75E7A000 C:\WINNT\system32\IMM32.dll
0x7CE20000 - 0x7CF0F000 C:\WINNT\system32\ole32.dll
0x18390000 - 0x183E1000 C:\j2sdk1.4.2_05\jre\bin\fontmanager.dll
0x72800000 - 0x72846000 C:\WINNT\system32\ddraw.dll
0x728A0000 - 0x728A6000 C:\WINNT\system32\DCIMAN32.dll
0x72CF0000 - 0x72D84000 C:\WINNT\system32\D3DIM700.DLL
0x60000000 - 0x60045000 C:\WINNT\system32\MSCTF.dll
0x7CF30000 - 0x7D175000 C:\WINNT\system32\shell32.dll
0x70BD0000 - 0x70C34000 C:\WINNT\system32\SHLWAPI.dll
0x71780000 - 0x7180A000 C:\WINNT\system32\COMCTL32.dll
0x779B0000 - 0x77A4B000 C:\WINNT\system32\OLEAUT32.DLL
0x7C950000 - 0x7C9DF000 C:\WINNT\system32\CLBCATQ.DLL
0x77840000 - 0x7787E000 C:\WINNT\system32\cscui.dll
0x770C0000 - 0x770E3000 C:\WINNT\system32\CSCDLL.DLL
0x76DF0000 - 0x76E01000 C:\WINNT\system32\mydocs.dll
0x71000000 - 0x71148000 C:\WINNT\system32\SHDOCVW.DLL
0x75160000 - 0x7516C000 C:\WINNT\System32\ntlanman.dll
0x7CDC0000 - 0x7CE13000 C:\WINNT\System32\NETAPI32.dll
0x77980000 - 0x779A4000 C:\WINNT\System32\DNSAPI.dll
0x75050000 - 0x75058000 C:\WINNT\System32\WSOCK32.dll
0x75030000 - 0x75044000 C:\WINNT\System32\WS2_32.DLL
0x75020000 - 0x75028000 C:\WINNT\System32\WS2HELP.DLL
0x751C0000 - 0x751C6000 C:\WINNT\System32\NETRAP.dll
0x77BF0000 - 0x77C01000 C:\WINNT\System32\NTDSAPI.dll
0x77950000 - 0x7797B000 C:\WINNT\system32\WLDAP32.DLL
0x7C340000 - 0x7C34F000 C:\WINNT\System32\SECUR32.DLL
0x75150000 - 0x75160000 C:\WINNT\System32\SAMLIB.dll
0x75210000 - 0x75225000 C:\WINNT\System32\NETUI0.dll
0x751D0000 - 0x75208000 C:\WINNT\System32\NETUI1.dll
0x1D230000 - 0x1D24A000 E:\IndexerModule_suneel_java\ForwardIndexerModule\HtmlParser
\RevConverterWrapper.dll
0x1D360000 - 0x1D384000 E:\IndexerModule_suneel_java\ForwardIndexerModule\HtmlParser
\ismapi32.dll
0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 C:\WINNT\system32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 576K, used 291K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 50% used [0x10010000, 0x10050790, 0x10090000)
from space 64K, 51% used [0x10090000, 0x100984a8, 0x100a0000)
to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation total 7360K, used 4458K [0x104f0000, 0x10c20000, 0x14010000)
the space 7360K, 60% used [0x104f0000, 0x1094aa40, 0x1094ac00, 0x10c20000)
compacting perm gen total 6144K, used 6134K [0x14010000, 0x14610000, 0x18010000)
the space 6144K, 99% used [0x14010000, 0x1460d8c0, 0x1460da00, 0x14610000)

Local Time = Mon Dec 19 08:41:39 2005
Elapsed Time = 76
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
#
# An error report file has been saved as hs_err_pid256.log.
# Please refer to the file for further information.
#


****************
Another exception has been detected while we were handling last error.
Dumping information about last error:
ERROR REPORT FILE = hs_err_pid256.log
PC = 0x77fcb6a3
SIGNAL = -1073741819
FUNCTION NAME = RtlAllocateHeap
OFFSET = 0x9B9
LIBRARY NAME = C:\WINNT\system32\ntdll.dll
Please check ERROR REPORT FILE for further information, if there is any.
Good bye.

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

There are many possible JNI errors that could lead to memory exhaustion; one example is calling GetStringUTFChars() without matching calls to ReleaseStringUTFChars(). If you show us your JNI code, we could look at it and maybe tell you about any problems.


[Jess in Action][AskingGoodQuestions]
 
jQuery in Action, 2nd edition
 
subject: JNI----JVM Out of memory