Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI----JVM Out of memory  RSS feed

suneel allareddy
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 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

Current Java thread:
at converter.RevConverterClass.convertIsfocToIScii(Native Method)
at converter.RevConverterClass.convertIsfocToIscii(
at HtmlParserClass.handleText(
at javax.swing.text.html.parser.DocumentParser.handleText(
at javax.swing.text.html.parser.Parser.handleText(
at javax.swing.text.html.parser.Parser.startTag(
at javax.swing.text.html.parser.Parser.parseTag(
at javax.swing.text.html.parser.Parser.parseContent(
at javax.swing.text.html.parser.Parser.parse(
- locked <0x10937768> (a javax.swing.text.html.parser.DocumentParser)
at javax.swing.text.html.parser.DocumentParser.parse(
at javax.swing.text.html.parser.ParserDelegator.parse(
at HtmlParserClass.stratModule(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.traverseDirectory(
at ForwardIndexerModule.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.jav
at javax.swing.DefaultButtonModel.fireActionPerformed(
at javax.swing.DefaultButtonModel.setPressed(
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
at java.awt.Component.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(

at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

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
0x1D360000 - 0x1D384000 E:\IndexerModule_suneel_java\ForwardIndexerModule\HtmlParser
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:
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
Posts: 24216
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!