Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Out of memory issue

Moderators: Vladimir Kondratyev, Anton Katilin

Out of memory issue

Postby tanuj » Thu Dec 30, 2004 10:42 pm

Hi - I am trying to profile my tomcat application it taking 300M upon startup. When I try to capture a snapshot, it throws out of memory error in tomcat saying it has requested 1.3xG of memory (I have this configuration -Xmx1200M). Any clues?


Tanuj Chatterjee
Principal Architect
DETERMINE Software, Inc.
Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Postby Vladimir Kondratyev » Fri Dec 31, 2004 10:41 am

How large is the snapshot file?
Vladimir Kondratyev
Posts: 1519
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby tanuj » Fri Dec 31, 2004 6:19 pm

Didn't even get to saving the snapshot - tomcat said out of memory and yourkit showed error.
Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Postby tanuj » Tue Mar 29, 2005 10:34 pm

I'm seeing the same problem with yourkit 4.0. Did anyone resolve this?

Tanuj Chatterjee
Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Postby Anton Katilin » Wed Mar 30, 2005 1:26 pm

Are you using Java 5.0 with JVMTI? Java versions prior to 5.0 are not capable by their design to profile huge heaps.
Anton Katilin
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

Postby tanuj » Wed Mar 30, 2005 3:11 pm

I am. The problem is that the original heap size is approximately 300M for tomcat. Only when I try to capture a memory snapshot, the memory snapshot (of tomcat) explodes out of proportions.
Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Postby Anton Katilin » Thu Mar 31, 2005 3:57 pm

Could you please provide exact messages printed in the console of Tomcat, including the first lines printed by YourKit profiler agent.
Anton Katilin
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

Tomcat message

Postby tanuj » Tue Apr 12, 2005 7:10 pm

Here is the message printed by tomcat. Yourkit disconnects itself when this happens.

# An unexpected error has been detected by HotSpot Virtual Machine:
# Internal Error (0xeefface), pid=3296, tid=3928
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode)
# Problematic frame:
# C [kernel32.dll+0x1eb33]

--------------- T H R E A D ---------------

Current thread (0x00e88d60): VMThread [id=3928]

siginfo: ExceptionCode=0xeefface, ExceptionInformation=0x00836384 0x0085cdc5 0x009f85dc

EAX=0x00d8fb74, EBX=0x00836354, ECX=0x00000000, EDX=0x009f85dc
ESP=0x00d8fb70, EBP=0x00d8fbc4, ESI=0x00d8fbf4, EDI=0x00000003
EIP=0x7c81eb33, EFLAGS=0x00000206

Top of Stack: (sp=0x00d8fb70)
0x00d8fb70: 00000004 0eefface 00000001 00000000
0x00d8fb80: 7c81eb33 00000003 00836384 0085cdc5
0x00d8fb90: 009f85dc 00000008 00000008 00000008
0x00d8fba0: 00000001 00000056 00d8fbc4 00865294
0x00d8fbb0: 009f862e 00d8fcc8 00000003 00000004
0x00d8fbc0: 00d8fbcc 00d8fc28 00865699 0eefface
0x00d8fbd0: 00000001 00000003 00d8fbe8 00d8fd04
0x00d8fbe0: 00000000 0c8f5408 00836384 0085cdc5

Instructions: (pc=0x7c81eb33)
0x7c81eb23: 8d 7d c4 f3 a5 5f 8d 45 b0 50 ff 15 04 15 80 7c
0x7c81eb33: 5e c9 c2 10 00 85 ff 0f 8e e6 d0 fe ff 8b 55 fc

Stack: [0x00d50000,0x00d90000), sp=0x00d8fb70, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [kernel32.dll+0x1eb33]
C [yjpagent.dll+0x35699]
C [yjpagent.dll+0x356d9]
C [yjpagent.dll+0x2cd0b]
C [yjpagent.dll+0x2cd74]
C [yjpagent.dll+0x2189b]
C [yjpagent.dll+0x2162d]
C [yjpagent.dll+0x1d253]
V [jvm.dll+0xbc5f7]
V [jvm.dll+0xbc5a8]
V [jvm.dll+0x117d4e]
V [jvm.dll+0x117825]
V [jvm.dll+0x1179c5]
V [jvm.dll+0x11775a]
C [MSVCRT.dll+0x2a3b0]
C [kernel32.dll+0xb50b]

VM_Operation (0x2776f388): JVMTI IterateOverHeap object closure, mode: safepoint, requested by thread 0x273798e8

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x27a3a970 JavaThread "Timer-0" daemon [_thread_blocked, id=3492]
0x27ad5998 JavaThread "TP-Monitor" daemon [_thread_blocked, id=1564]
0x27ad4f88 JavaThread "TP-Processor4" daemon [_thread_in_native, id=3660]
0x27ada490 JavaThread "TP-Processor3" daemon [_thread_blocked, id=3620]
0x27ad7470 JavaThread "TP-Processor2" daemon [_thread_blocked, id=3344]
0x27ad72f0 JavaThread "TP-Processor1" daemon [_thread_blocked, id=3700]
0x27bcb5d0 JavaThread "http-8080-Monitor" [_thread_blocked, id=640]
0x27a77f90 JavaThread "http-8080-Processor25" daemon [_thread_blocked, id=440]
0x27a77458 JavaThread "http-8080-Processor24" daemon [_thread_blocked, id=1380]
0x27a76920 JavaThread "http-8080-Processor23" daemon [_thread_in_native, id=964]
0x27a75de8 JavaThread "http-8080-Processor22" daemon [_thread_blocked, id=2984]
0x27a75340 JavaThread "http-8080-Processor21" daemon [_thread_blocked, id=1784]
0x27a73ff8 JavaThread "http-8080-Processor20" daemon [_thread_blocked, id=500]
0x27a734c0 JavaThread "http-8080-Processor19" daemon [_thread_blocked, id=400]
0x27a72988 JavaThread "http-8080-Processor18" daemon [_thread_blocked, id=176]
0x27a71e50 JavaThread "http-8080-Processor17" daemon [_thread_blocked, id=844]
0x27a71318 JavaThread "http-8080-Processor16" daemon [_thread_blocked, id=1748]
0x27a70870 JavaThread "http-8080-Processor15" daemon [_thread_blocked, id=4064]
0x27a6b930 JavaThread "http-8080-Processor14" daemon [_thread_blocked, id=4052]
0x27a6adf8 JavaThread "http-8080-Processor13" daemon [_thread_blocked, id=1280]
0x27a6a2c0 JavaThread "http-8080-Processor12" daemon [_thread_blocked, id=4080]
0x27a69788 JavaThread "http-8080-Processor11" daemon [_thread_blocked, id=4060]
0x27a68c50 JavaThread "http-8080-Processor10" daemon [_thread_blocked, id=4084]
0x27a681a8 JavaThread "http-8080-Processor9" daemon [_thread_blocked, id=3860]
0x27a66ea0 JavaThread "http-8080-Processor8" daemon [_thread_blocked, id=3820]
0x27a66408 JavaThread "http-8080-Processor7" daemon [_thread_blocked, id=4044]
0x27ac9490 JavaThread "http-8080-Processor6" daemon [_thread_blocked, id=3932]
0x27ac8a28 JavaThread "http-8080-Processor5" daemon [_thread_blocked, id=1276]
0x27ac7fc0 JavaThread "http-8080-Processor4" daemon [_thread_blocked, id=3800]
0x27aca740 JavaThread "http-8080-Processor3" daemon [_thread_blocked, id=4016]
0x27ac9d20 JavaThread "http-8080-Processor2" daemon [_thread_blocked, id=3888]
0x27acadf8 JavaThread "http-8080-Processor1" daemon [_thread_blocked, id=4008]
0x27712ca8 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=3812]
0x27a6f728 JavaThread "QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler" [_thread_blocked, id=1756]
0x276f1cb8 JavaThread "TestScheduler_QuartzSchedulerThread" [_thread_blocked, id=4020]
0x276f02a0 JavaThread "TestScheduler_Worker-9" [_thread_blocked, id=3976]
0x276eeff0 JavaThread "TestScheduler_Worker-8" [_thread_blocked, id=3828]
0x276e6558 JavaThread "TestScheduler_Worker-7" [_thread_blocked, id=3912]
0x276e5bd8 JavaThread "TestScheduler_Worker-6" [_thread_blocked, id=1616]
0x276e7be8 JavaThread "TestScheduler_Worker-5" [_thread_blocked, id=3972]
0x276e7a68 JavaThread "TestScheduler_Worker-4" [_thread_blocked, id=2900]
0x276eb430 JavaThread "TestScheduler_Worker-3" [_thread_blocked, id=784]
0x276eb2b0 JavaThread "TestScheduler_Worker-2" [_thread_blocked, id=2884]
0x27684420 JavaThread "TestScheduler_Worker-1" [_thread_blocked, id=1576]
0x276eccc0 JavaThread "TestScheduler_Worker-0" [_thread_blocked, id=3340]
0x27b8c968 JavaThread "Thread-2" [_thread_blocked, id=3392]
0x279cb748 JavaThread "Thread-1" daemon [_thread_blocked, id=3856]
0x273e3cb8 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3736]
0x2732fdc8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3740]
0x27164c10 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2768]
0x27379a68 JavaThread "YJP CPU Sampler" daemon [_thread_blocked, id=3780]
0x273798e8 JavaThread "YJP RequestServer" daemon [_thread_blocked, id=3764]
0x00e8bf00 JavaThread "Finalizer" daemon [_thread_blocked, id=268]
0x00e8aa68 JavaThread "Reference Handler" daemon [_thread_blocked, id=2348]
0x00357f08 JavaThread "main" [_thread_in_native, id=3916]

Other Threads:
=>0x00e88d60 VMThread [id=3928]
0x00e94d18 WatcherThread [id=1024]

VM state:at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x0035abd0/0x00001f18] Threads_lock - owner thread: 0x00e88d60
[0x0035ad50/0x00001edc] Heap_lock - owner thread: 0x273798e8

def new generation total 31552K, used 13959K [0x02ed0000, 0x05100000, 0x05630000)
eden space 28096K, 40% used [0x02ed0000, 0x039df770, 0x04a40000)
from space 3456K, 76% used [0x04a40000, 0x04cd26d8, 0x04da0000)
to space 3456K, 0% used [0x04da0000, 0x04da0000, 0x05100000)
tenured generation total 418968K, used 325630K [0x05630000, 0x1ef56000, 0x22ed0000)
the space 418968K, 77% used [0x05630000, 0x1942f9c0, 0x1942fa00, 0x1ef56000)
compacting perm gen total 20480K, used 20379K [0x22ed0000, 0x242d0000, 0x26ed0000)
the space 20480K, 99% used [0x22ed0000, 0x242b6f98, 0x242b7000, 0x242d0000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040c000 C:\Program Files\Java\jdk1.5.0_02\bin\javaw.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x6d6b0000 - 0x6d835000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\client\jvm.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x6d2f0000 - 0x6d2f8000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x00830000 - 0x0088f000 C:\YourKit Java Profiler 4.0.app\bin\win32\yjpagent.dll
0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.DLL
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x6d680000 - 0x6d68c000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\verify.dll
0x6d370000 - 0x6d38d000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\java.dll
0x6d6a0000 - 0x6d6af000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\zip.dll
0x6d530000 - 0x6d543000 C:\Program Files\Java\jdk1.5.0_02\jre\bin\net.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\system32\mswsock.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll

VM Arguments:
jvm_args: -agentlib:yjpagent=sessionname=YJPQUOTED546f6d63617420352e7820286c61756e636865642066726f6d2045636c6970736529 -Xrunyjpagent:sessionname=YJPQUOTED546f6d63617420352e7820286c61756e636865642066726f6d2045636c6970736529 -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Xmx1024m -Xmx512m
java_command: org.apache.catalina.startup.Bootstrap -config C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml start

Environment Variables:
PATH=C:\oracle\ora92\bin;C:\Program Files\Java\jdk1.5.0_02\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Perforce;C:\ant\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\YourKit Java Profiler 4.0.app\bin\win32
PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 4, GenuineIntel

--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht

Memory: 4k page, physical 2088240k(490444k free), swap 4030232k(2484724k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_02-b09) for windows-x86, built on Mar 4 2005 01:53:53 by "java_re" with MS VC++ 6.0
Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Postby Anton Katilin » Wed Apr 13, 2005 10:03 am


Thank you for the trace.

Could you please make sure you are using the latest build of YourKit Java Profiler (4.0.7 at the moment, can be found at http://www.yourkit.com/download ).

I see you launch profiled program from IDE. Please don't forget to update profiler plugin (this will be automatically offered when you launch new profiler build first time).

Furthermore, I can see you have C:\YourKit Java Profiler 4.0.app\bin\win32 in your PATH, which is actually Mac OS X version of the profiler distribution. On Windows it is desired to use executable installer or plain zip (not Mac OS X-version zip)

Best regards,
Anton Katilin
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

That worked!

Postby tanuj » Mon Jun 13, 2005 5:18 am

Posts: 6
Joined: Thu Dec 30, 2004 10:37 pm

Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.