Bug in JVM

I was trying to call Unsafe.defineClass() method of the class Unsafe but it always returns null
the line code is
defineClass(name, arr, 0, arr.length) ;
I opened the jvm.dll in hexeditor and found that there is no entry for this method in jvm.dll also.
is this an error or I should use a different method.
Please help me ...
thanks

Sorry i missed it is happening with jdk1.6 only. while working fine with jdk 1.5 and earlier versions.
I have tried it with jdk 1.6 update 1 also but it fails.
thanks

Similar Messages

  • Is this a bug in JVM?

    Hello all.
    Whenever I try to make JNI calls to Ms Word in multiclient environment on server, the JVM closes with the following message.
    Another exception has been detected while we were handling last error.
    Dumping information about last error:
    ERROR REPORT FILE = (N/A)
    PC = 0x19BFC46D
    SIGNAL = -1073741819
    FUNCTION NAME = (N/A)
    OFFSET = 0xFFFFFFFF
    I am using JRE1.4.0 .
    The heap size of JVM I have set is 256 MB.
    Is this a bug in JVM?
    Please guide me in this problem if possible because it is urgent for me.
    Thanks in advance.

    Hallo,
    if I understand your problem correctly, you are trying to call MS Word on your server from Java code in your server. This is not to be recommended!
    I have seen references to this problem elsewhere in the Sun forums but cannot at the moment find them. There is also something in MSDN. As far as I remember, the story goes like this:
    1. Word is a program for client PCs.
    2. Word expects to have a GUI available for it to display messages and so on.
    3. Although you can control Word over OLE, 1 and 2 above still apply.
    4. If you still want to use Word in your server, then on your own head be it.

  • Is it a bug in JVM 1.4.2_05 ?

    Hi All,
    We are using hotspot JVM 1.4.2_05 for one of our J2EE applications. The J2EE server is WebLogic 8.1 Sp2.
    We are facing a problem with sudden JVM crash after the perm gen getting utilized to till 99%.
    We tried with maxPermSize as 64 MB as well as 128MB. But in both the cases the JVM uses total perm gen something around 45-46 MB.
    We are unable to understand even in case of 128MB of maxPermSize why JVM is not able to increase the total perm gen and instead went for a crash. Is it a bug in this specific JVM version ?
    Any pointer/idea would be really helpful.
    Regards,
    Sourav

    Hi Cfuishien,
    Thanks again for your input.
    We actually ran it again without -Xbatch and with -XX:+PrintCompilation. The system crashed. I'm adding here the top part of the pstack output and the last part of the massege appeared in log file at the time of crash.
    Please let me know if you need any further input.
    pstack output -
    core 'UATcore.20040829-1' of 8867:     /usr/j2se/bin/java -server -Xms2048m -Xmx2048m -XX:MaxPermSize=128m -X
    ----------------- lwp# 12 / thread# 11 --------------------
    ff379780 __sigprocmask (ff37bf7c, 0, 0, 70901d70, ff38e000, 0) + 8
    ff36e110 _sigon   (70901d70, ff395930, 6, 708ff40c, 70901d70, ff39527c) + d0
    ff371150 thrpkill (0, b, 6, ff38e000, b, ff340450) + f8
    ff2cba74 raise (6, 0, 0, ffffffff, ff3403bc, ff39525c) + 40
    ff2b595c abort (ff33c000, 708ff560, 0, fffffff8, 4, 708ff581) + 100
    fe499d98 __1cCosFabort6Fi_v_ (1, fe53ad22, 708ffde0, fe56f8a2, fe56f83a, ff0000) + 80
    fe37d35c __1cMreport_error6Fipkci11E_v_ (708ffdfc, fe5d8b3c, fe53aaec, fe532cd0, fe53ab35, 708fff40) + 668
    fe37c8e4 __1cMreport_fatal6Fpkci1E_v_ (fe532c8b, 5e, fe532cd1, fe532c74, e, 40) + 58
    fe17f928 __1cKCodeBuffer2t6MiiiiiipnKBufferBlob_pnJrelocInfo_pnORelocateBuffer_ipnLOopRecorder_pkci_v_ (fe582000, 0, c00, 1000, 400, 0) + c0
    fe1cefe8 __1cKCodeBufferGresize6Miiii_v_ (11b08bc, 7800, 1000, 400, c00, a6) + 98
    fe1d3174 __1cHCompileLFill_buffer6M_v_ (70901270, 0, 121dd68, 121dda8, 85d8e8, 49cd08) + b40
    fe1d857c __1cHCompileGOutput6M_v_ (9, 0, 45, 0, 0, 0) + 8e8
    fe1d1a44 __1cHCompileICode_Gen6M_v_ (70901270, fe53526c, 70901184, fe582000, 0, 0) + 53c
    fe1ff690 __1cHCompile2t6MpnFciEnv_pnHciScope_pnIciMethod_iii_v_ (fe5350a1, 1021524, 258b34, e8a674, ffffffff, 1) + be0
    fe1fbe34 __1cKC2CompilerOcompile_method6MpnFciEnv_pnHciScope_pnIciMethod_ii_v_ (a0828, 70901a8c, 0, 1023060, ffffffff, 0) + 64
    fe1fb5f8 __1cNCompileBrokerZinvoke_compiler_on_method6FpnLCompileTask__v_ (ab2, 0, ffffffff, fe5c0e70, fe5cdc6c, f47c8) + 61c
    fe2aae80 __1cNCompileBrokerUcompiler_thread_loop6F_v_ (fe5358a9, fe5c1238, f47c8, f4d78, 31a08c, fe267ed8) + 428
    fe267f00 __1cKJavaThreadDrun6M_v_ (f47c8, c, 40, 0, b, ff38e000) + 284
    fe2643e0 _start   (f47c8, ff38f688, 1, 1, ff38e000, 0) + 134
    ff37b744 threadstart (f47c8, 0, 0, 0, 0, 0) + 40
    ----------------- lwp# 13 / thread# 12 --------------------
    ff31d348 _poll    (0, 0, 0, f9581b18, ff33f1b4, f9581b18) + 8
    ff37b150 select (0, 32, 0, 0, 0, 1) + 34
    fe10633c __1cCosFsleep6FpnGThread_xi_i_ (f5648, 0, 32, 0, 1, f9581c85) + 214
    fe2bfb5c __1cNWatcherThreadDrun6M_v_ (f5648, d, 7f, 0, c, ff38e000) + 1e4
    fe2643e0 _start   (f5648, ff38f688, 1, 1, ff38e000, 0) + 134
    ff37b744 threadstart (f5648, 0, 0, 0, 0, 0) + 40
    ----------------- lwp# 14 / thread# 13 --------------------
    ff31f170 ___lwp_cond_wait (1b8f68, 1b8f50, 52d770, 0, 0, 0) + 8
    fe24d680 __1cNObjectMonitorEwait6MxipnGThread__v_ (5000, 5280, 5000, 5100, 52d770, 4a1dcc) + 5ac
    fe24cbc0 JVM_MonitorWait (52d804, 70581774, 0, 0, 52d770, 0) + 158
    f980b96c ???????? (70581774, b6, 0, ffffffff, 0, 0)
    f9805804 ???????? (705817ec, b6, 0, f9815e84, c, 70581710)
    f9805804 ???????? (7058187c, b7, 0, f9815e50, 4, 70581790)
    f9805804 ???????? (7058190c, 0, 0, f98160d0, 4, 70581818)
    f980010c ???????? (70581998, 70581c00, a, f1d6ca50, 4, 705818b0)
    fe15bcf8 __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ (70581bf8, 70581a60, 70581b18, 52d770, 52d770, 70581a70) + 27c
    fe24a3e4 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ (fe582000, 1ba478, 70581b0c, 70581b08, 70581b18, 52d770) + 164
    fe25d5a8 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ (70581bf8, 70581bf4, 70581bec, 70581be4, 70581bdc, 52d770) + 6c
    fe26e8f8 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (52d770, 52d770, 6de808, 1ba478, 31a08c, fe267ed8) + 128
    fe267f00 __1cKJavaThreadDrun6M_v_ (52d770, e, 40, 0, d, ff38e000) + 284
    fe2643e0 _start   (52d770, ff38f688, 1, 1, ff38e000, 0) + 134
    ff37b744 threadstart (52d770, 0, 0, 0, 0, 0) + 40
    The last part of error log
    {082=/export/home/bea/rwsfolders/MailFormat_Uploaded/08_2.xml, 101=/export/home/bea/rwsfolders/MailFormat_Uploaded/10_1
    .jasper, 143=/export/home/bea/rwsfolders/MailFormat_Uploaded/14_3.jasper, 031=/export/home/bea/rwsfolders/MailFormat_Up
    loaded/03_1.jasper, 282=/export/home/bea/rwsfolders/MailFormat_Uploaded/28_2.jasper|/export/home/bea/rwsfolders/MailFor
    mat_Uploaded/28_2_SubReport1.jasper|/export/home/bea/rwsfolders/MailFormat_Uploaded/28_2_SubReport2.jasper, 011=/export
    /home/bea/rwsfolders/MailFormat_Uploaded/01_1.jasper, 032=/export/home/bea/rwsfolders/MailFormat_Uploaded/03_2.xml, 061
    =/export/home/bea/rwsfolders/MailFormat_Uploaded/06_1.jasper, 191=/export/home/bea/rwsfolders/MailFormat_Uploaded/19_1.
    jasper, 151=/export/home/bea/rwsfolders/MailFormat_Uploaded/15_1.jasper, 051=/export/home/bea/rwsfolders/MailFormat_Upl
    oaded/05_1.jasper, 281=/export/home/bea/rwsfolders/MailFormat_Uploaded/28_1.jasper, 073=/export/home/bea/rwsfolders/Mai
    lFormat_Uploaded/07_3.xml, 033=/export/home/bea/rwsfolders/MailFormat_Uploaded/03_3.jasper, 141=/export/home/bea/rwsfol
    ders/MailFormat_Uploaded/14_1.jasper, 091=/export/home/bea/rwsfolders/MailFormat_Uploaded/09_1.jasper, 142=/export/home
    /bea/rwsfolders/MailFormat_Uploaded/14_2.jasper|/export/home/bea/rwsfolders/MailFormat_Uploaded/14_2_SubReport1.jasper|
    /export/home/bea/rwsfolders/MailFormat_Uploaded/14_2_SubReport2.jasper, 041=/export/home/bea/rwsfolders/MailFormat_Uplo
    aded/04_1.jasper, 081=/export/home/bea/rwsfolders/MailFormat_Uploaded/08_1.jasper}
    /export/home/bea/rwsfolders/MailFormat_Uploaded/09_1.jasper
    091
    Entering for the first time.
    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Server VM (1.4.2_05-b04 mixed mode)
    # Error ID: 434F44452255464645520E435050005E 01
    # Problematic Thread: prio=5 tid=0x000f47c8 nid=0xb runnable
    Heap at VM Abort:
    Heap
    def new generation total 678464K, used 531362K [0x71400000, 0x9bea0000, 0x9bea0000)
    eden space 657920K, 80% used [0x71400000, 0x91ae8aa0, 0x99680000)
    from space 20544K, 0% used [0x99680000, 0x99680000, 0x9aa90000)
    to space 20544K, 0% used [0x9aa90000, 0x9aa90000, 0x9bea0000)
    tenured generation total 1398144K, used 42149K [0x9bea0000, 0xf1400000, 0xf1400000)
    the space 1398144K, 3% used [0x9bea0000, 0x9e7c9700, 0x9e7c9800, 0xf1400000)
    compacting perm gen total 37888K, used 37722K [0xf1400000, 0xf3900000, 0xf9400000)
    the space 37888K, 99% used [0xf1400000, 0xf38d6990, 0xf38d6a00, 0xf3900000)
    Abort - core dumped
    Regards,
    Sourav

  • A question about Oracle installer and a possible bug in JVM

    Hello,
    I appreciate if you could kindly guide me to solve the following problem.
    I'm trying to install Oracle11g Enterprise on a Linux system (Redhat Enterprise 5.3).
    There is no X system, and therefore I chose to install by using a response file
    in silent mode. I set the parameters value as indicated in Oracle installation
    guide. Yet, when I launch the installer, it seems that there is a problem with
    java:
    [oracle@ccsaplinux0002 database]$ ./runInstaller -responseFile /usr/local/oracle/database/responseFileV01.rsp -silent
    Starting Oracle Universal Installer...
    Checking Temp space: must be greater than 80 MB.   Actual 34517 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 8189 MB    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-08-10_06-53-41PM. Please wait ...[oracle@ccsaplinux0002 database]$ Oracle Universal Installer, Version 11.1.0.6.0 Production
    Copyright (C) 1999, 2007, Oracle. All rights reserved.
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #  SIGSEGV (0xb) at pc=0xb7948692, pid=2854, tid=3086293200
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
    # Problematic frame:
    # V  [libjvm.so+0x19c692]
    # An error report file with more information is saved as hs_err_pid2854.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    [oracle@ccsaplinux0002 database]$I looked in the oracle package that I downloaded, there was no jdk or jre direcotry.
    As a result I downloaded the JDK 1.6.0_15 available on Sun microsystem web site and then
    I set manually in oracle user ~/.bash_profile the value for $JAVA_HOME.
    Why I get this error?
    Thanks in advance,
    Dariush
    :)

    schavali wrote:
    >
    # An error report file with more information is saved as hs_err_pid2854.log
    >
    Can you post the contents of this error log ?
    HTH
    SriniHello there,
    Thanks for your attention to my problem. Here is the file:
    Kind Regards,
    Dariyoosh
    [root@ccsaplinux0002 oracle]# cat /tmp/hs_err_pid2854.log
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #  SIGSEGV (0xb) at pc=0xb7948692, pid=2854, tid=3086293200
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
    # Problematic frame:
    # V  [libjvm.so+0x19c692]
    ---------------  T H R E A D  ---------------
    Current thread (0x0805f5c0):  JavaThread "main" [_thread_in_vm, id=2854]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000000
    Registers:
    EAX=0x00000000, EBX=0xb7b3716c, ECX=0x000bfd68, EDX=0x00000001
    ESP=0xbfd68950, EBP=0xbfd689b4, ESI=0x0805f748, EDI=0xb7b49fa0
    EIP=0xb7948692, CR2=0x00000000, EFLAGS=0x00010286
    Top of Stack: (sp=0xbfd68950)
    0xbfd68950:   b7b3716c bfd68974 b79485e7 bfd68990
    0xbfd68960:   00000000 bfd68980 b7b3716c 0805f748
    0xbfd68970:   08060320 08060328 08060714 0805f5c0
    0xbfd68980:   bfd68994 0805f5c0 00000000 0805f5c0
    0xbfd68990:   bfd68a1c 00000000 08060730 0805f5c0
    0xbfd689a0:   08060774 08060774 aec60018 aec60018
    0xbfd689b0:   0805f680 bfd68a0c a371553b 0805f680
    0xbfd689c0:   00000000 00000000 aec60018 aec60018
    Instructions: (pc=0xb7948692)
    0xb7948682:   bc 8b 46 08 89 45 c0 8b 46 0c 89 45 c4 8b 45 0c
    0xb7948692:   8b 00 50 e8 f6 f3 fd ff 83 ec 0c 89 c7 50 e8 f3
    Stack: [0xbfb6e000,0xbfd6e000),  sp=0xbfd68950,  free space=2026k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x19c692]
    C  [liboraInstaller.so+0x453b]  Java_oracle_sysman_oii_oiip_osd_unix_OiipuUnixOps_chgrp+0x19
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.changeGroup(Ljava/lang/String;)Z+19
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.writeInvLoc(Loracle/sysman/oii/oiic/OiicSessionInterfaceManager;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V+86
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.updateInventoryLoc(Loracle/sysman/oii/oiic/OiicSessionInterfaceManager;Ljava/lang/String;Ljava/lang/String;)V+42
    j  oracle.sysman.oii.oiic.OiicSessionInterfaceManager.doInvSetupOperations(Ljava/lang/String;Ljava/lang/String;)I+21
    j  oracle.sysman.oii.oiic.OiicSilentInterfaceManager.doInvSetupOperations(Ljava/lang/String;Ljava/lang/String;)I+3
    j  oracle.sysman.oii.oiic.OiicInvSetupWCCE.doOperation(Z)I+73
    j  oracle.sysman.oii.oiif.oiifb.OiifbCondIterator.iterate(Z)I+249
    j  oracle.sysman.oii.oiic.OiicPullSession.doOperation(Z)I+11
    j  oracle.sysman.oii.oiic.OiicSessionWrapper.doOperation(Z)I+100
    j  oracle.sysman.oii.oiic.OiicInstaller.run()V+48
    j  oracle.sysman.oii.oiic.OiicInstaller.runInstaller([Ljava/lang/String;)I+107
    j  oracle.sysman.oii.oiic.OiicInstaller.main([Ljava/lang/String;)V+6
    v  ~StubRoutines::call_stub
    V  [libjvm.so+0x17ad8c]
    V  [libjvm.so+0x28efd8]
    V  [libjvm.so+0x17abbf]
    V  [libjvm.so+0x1a5472]
    V  [libjvm.so+0x196682]
    C  [java+0x1873]
    C  [libc.so.6+0x15e8c]  __libc_start_main+0xdc
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.chgrp(Ljava/lang/String;Ljava/lang/String;)I+0
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.changeGroup(Ljava/lang/String;)Z+19
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.writeInvLoc(Loracle/sysman/oii/oiic/OiicSessionInterfaceManager;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V+86
    j  oracle.sysman.oii.oiip.oiipg.OiipgBootstrap.updateInventoryLoc(Loracle/sysman/oii/oiic/OiicSessionInterfaceManager;Ljava/lang/String;Ljava/lang/String;)V+42
    j  oracle.sysman.oii.oiic.OiicSessionInterfaceManager.doInvSetupOperations(Ljava/lang/String;Ljava/lang/String;)I+21
    j  oracle.sysman.oii.oiic.OiicSilentInterfaceManager.doInvSetupOperations(Ljava/lang/String;Ljava/lang/String;)I+3
    j  oracle.sysman.oii.oiic.OiicInvSetupWCCE.doOperation(Z)I+73
    j  oracle.sysman.oii.oiif.oiifb.OiifbCondIterator.iterate(Z)I+249
    j  oracle.sysman.oii.oiic.OiicPullSession.doOperation(Z)I+11
    j  oracle.sysman.oii.oiic.OiicSessionWrapper.doOperation(Z)I+100
    j  oracle.sysman.oii.oiic.OiicInstaller.run()V+48
    j  oracle.sysman.oii.oiic.OiicInstaller.runInstaller([Ljava/lang/String;)I+107
    j  oracle.sysman.oii.oiic.OiicInstaller.main([Ljava/lang/String;)V+6
    v  ~StubRoutines::call_stub
    ---------------  P R O C E S S  ---------------
    Java Threads: ( => current thread )
      0x080cbc18 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2860]
      0x080ca708 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2859]
      0x080c9790 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2858]
      0x080bfc08 JavaThread "Finalizer" daemon [_thread_blocked, id=2857]
      0x080bddc0 JavaThread "Reference Handler" daemon [_thread_blocked, id=2856]
    =>0x0805f5c0 JavaThread "main" [_thread_in_vm, id=2854]
    Other Threads:
      0x080bb0f0 VMThread [id=2855]
      0x080cd1e0 WatcherThread [id=2861]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation   total 576K, used 458K [0xa5150000, 0xa51f0000, 0xa5cd0000)
      eden space 512K,  85% used [0xa5150000, 0xa51bdb50, 0xa51d0000)
      from space 64K,  29% used [0xa51d0000, 0xa51d4cb8, 0xa51e0000)
      to   space 64K,   0% used [0xa51e0000, 0xa51e0000, 0xa51f0000)
    tenured generation   total 1408K, used 1367K [0xa5cd0000, 0xa5e30000, 0xae750000)
       the space 1408K,  97% used [0xa5cd0000, 0xa5e25eb0, 0xa5e26000, 0xa5e30000)
    compacting perm gen  total 8192K, used 5575K [0xae750000, 0xaef50000, 0xb2750000)
       the space 8192K,  68% used [0xae750000, 0xaecc1ec0, 0xaecc2000, 0xaef50000)
    No shared spaces configured.
    Dynamic libraries:
    0078f000-007a9000 r-xp 00000000 03:01 10762034   /lib/ld-2.5.so
    007a9000-007aa000 r-xp 00019000 03:01 10762034   /lib/ld-2.5.so
    007aa000-007ab000 rwxp 0001a000 03:01 10762034   /lib/ld-2.5.so
    007ad000-008eb000 r-xp 00000000 03:01 10762035   /lib/libc-2.5.so
    008eb000-008ed000 r-xp 0013e000 03:01 10762035   /lib/libc-2.5.so
    008ed000-008ee000 rwxp 00140000 03:01 10762035   /lib/libc-2.5.so
    008ee000-008f1000 rwxp 00000000 00:00 0
    008f3000-008f5000 r-xp 00000000 03:01 10762039   /lib/libdl-2.5.so
    008f5000-008f6000 r-xp 00001000 03:01 10762039   /lib/libdl-2.5.so
    008f6000-008f7000 rwxp 00002000 03:01 10762039   /lib/libdl-2.5.so
    008f9000-0091e000 r-xp 00000000 03:01 10762037   /lib/libm-2.5.so
    0091e000-0091f000 r-xp 00024000 03:01 10762037   /lib/libm-2.5.so
    0091f000-00920000 rwxp 00025000 03:01 10762037   /lib/libm-2.5.so
    00922000-00935000 r-xp 00000000 03:01 10762038   /lib/libpthread-2.5.so
    00935000-00936000 r-xp 00012000 03:01 10762038   /lib/libpthread-2.5.so
    00936000-00937000 rwxp 00013000 03:01 10762038   /lib/libpthread-2.5.so
    00937000-00939000 rwxp 00000000 00:00 0
    00aac000-00abf000 r-xp 00000000 03:01 10762054   /lib/libnsl-2.5.so
    00abf000-00ac0000 r-xp 00012000 03:01 10762054   /lib/libnsl-2.5.so
    00ac0000-00ac1000 rwxp 00013000 03:01 10762054   /lib/libnsl-2.5.so
    00ac1000-00ac3000 rwxp 00000000 00:00 0
    08048000-08057000 r-xp 00000000 03:01 1145290    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/bin/java
    08057000-08059000 rwxp 0000e000 03:01 1145290    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/bin/java
    08059000-0861c000 rwxp 00000000 00:00 0          [heap]
    a3711000-a371b000 r-xp 00000000 03:01 1145413    /tmp/OraInstall2009-08-10_06-53-41PM/oui/lib/linux/liboraInstaller.so
    a371b000-a371d000 rwxp 00009000 03:01 1145413    /tmp/OraInstall2009-08-10_06-53-41PM/oui/lib/linux/liboraInstaller.so
    a371d000-a37f4000 r-xs 00000000 03:01 1145388    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/srvm.jar
    a37f4000-a387e000 r-xs 00000000 03:01 1145387    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/xml.jar
    a387e000-a3884000 r-xs 00000000 03:01 1145386    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/ojmisc.jar
    a3884000-a3899000 r-xs 00000000 03:01 1145385    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/orai18n-mapping.jar
    a3899000-a399d000 r-xs 00000000 03:01 1145384    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/orai18n-collation.jar
    a399d000-a39da000 r-xs 00000000 03:01 1145366    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/jewt4-nls.jar
    a39da000-a3be7000 r-xs 00000000 03:01 1145365    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/jewt4.jar
    a3be7000-a3d05000 r-xs 00000000 03:01 1145383    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/classes12.jar
    a3d05000-a3d0d000 r-xs 00000000 03:01 1145381    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/swingaccess.jar
    a3d0d000-a3d5a000 r-xs 00000000 03:01 1145364    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/ewt3-nls.jar
    a3d5a000-a3d60000 r-xs 00000000 03:01 1145382    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/ewt3-swingaccess.jar
    a3d60000-a3f28000 r-xs 00000000 03:01 1145363    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/ewt3.jar
    a3f28000-a3f4f000 r-xs 00000000 03:01 1145368    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/help4-nls.jar
    a3f4f000-a3fc3000 r-xs 00000000 03:01 1145367    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/help4.jar
    a3fc3000-a4078000 r-xs 00000000 03:01 1145380    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/oracle_ice.jar
    a4078000-a409b000 r-xs 00000000 03:01 1145378    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_zh_TW.jar
    a409b000-a40be000 r-xs 00000000 03:01 1145377    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_zh_CN.jar
    a40be000-a40e1000 r-xs 00000000 03:01 1145376    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_pt_BR.jar
    a40e1000-a4103000 r-xs 00000000 03:01 1145375    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_ko.jar
    a4103000-a4124000 r-xs 00000000 03:01 1145374    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_ja.jar
    a4124000-a4146000 r-xs 00000000 03:01 1145373    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_it.jar
    a4146000-a416a000 r-xs 00000000 03:01 1145372    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_fr.jar
    a416a000-a418c000 r-xs 00000000 03:01 1145371    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_es.jar
    a418c000-a41b0000 r-xs 00000000 03:01 1145370    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp_de.jar
    a41b0000-a41d0000 r-xs 00000000 03:01 1145369    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstHelp.jar
    a41d0000-a41f1000 r-xs 00000000 03:01 1145379    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/InstImages.jar
    a41f1000-a422b000 r-xs 00000000 03:01 1145432    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/http_client.jar
    a422b000-a4266000 r-xs 00000000 03:01 1145389    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/remoteinterfaces.jar
    a4266000-a4271000 r-xs 00000000 03:01 1145390    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/ssh.jar
    a4271000-a429c000 r-xs 00000000 03:01 1145391    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/jsch.jar
    a429c000-a42e5000 r-xs 00000000 03:01 1145427    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/OraPrereq.jar
    a42e5000-a43c6000 r-xs 00000000 03:01 1145425    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/emCfg.jar
    a43c6000-a43c8000 r-xs 00000000 03:01 1145429    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/OraInstallerNet.jar
    a43c8000-a43d6000 r-xs 00000000 03:01 1145430    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/share.jar
    a43d6000-a4534000 r-xs 00000000 03:01 1145426    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/xmlparserv2.jar
    a4534000-a454e000 r-xs 00000000 03:01 1145424    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/oneclick.jar
    a454e000-a4967000 r-xs 00000000 03:01 1145428    /tmp/OraInstall2009-08-10_06-53-41PM/oui/jlib/OraInstaller.jar
    a4967000-a497c000 r-xs 00000000 03:01 1177352    /tmp/OraInstall2009-08-10_06-53-41PM/ext/jlib/orai18n-mapping.jar
    a497c000-a49df000 r-xs 00000000 03:01 1177351    /tmp/OraInstall2009-08-10_06-53-41PM/ext/jlib/orai18n-utility.jar
    a49df000-a4a06000 r-xs 00000000 03:01 1145126    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/ext/sunjce_provider.jar
    a4a06000-a4acb000 r-xs 00000000 03:01 1145125    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/ext/localedata.jar
    a4acb000-a4af6000 r-xs 00000000 03:01 1145127    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/ext/sunpkcs11.jar
    a4af6000-a4af7000 ---p 00000000 00:00 0
    a4af7000-a4b77000 rwxp 00000000 00:00 0
    a4b77000-a4b7a000 ---p 00000000 00:00 0
    a4b7a000-a4bf8000 rwxp 00000000 00:00 0
    a4bf8000-a4bfb000 ---p 00000000 00:00 0
    a4bfb000-a4c79000 rwxp 00000000 00:00 0
    a4c79000-a4c7c000 ---p 00000000 00:00 0
    a4c7c000-a4cfa000 rwxp 00000000 00:00 0
    a4cfa000-a4efa000 r-xp 00000000 03:01 10994471   /usr/lib/locale/locale-archive
    a4efa000-a4efd000 ---p 00000000 00:00 0
    a4efd000-a4f7b000 rwxp 00000000 00:00 0
    a4f7b000-a4f7e000 ---p 00000000 00:00 0
    a4f7e000-a4ffc000 rwxp 00000000 00:00 0
    a4ffc000-a4ffd000 ---p 00000000 00:00 0
    a4ffd000-a5082000 rwxp 00000000 00:00 0
    a5082000-a509e000 rwxp 00000000 00:00 0
    a509e000-a509f000 rwxp 00000000 00:00 0
    a509f000-a50e4000 rwxp 00000000 00:00 0
    a50e4000-a50e5000 rwxp 00000000 00:00 0
    a50e5000-a50e9000 rwxp 00000000 00:00 0
    a50e9000-a50eb000 rwxp 00000000 00:00 0
    a50eb000-a512f000 rwxp 00000000 00:00 0
    a512f000-a5133000 rwxp 00000000 00:00 0
    a5133000-a514f000 rwxp 00000000 00:00 0
    a514f000-a51f0000 rwxp 00000000 00:00 0
    a51f0000-a5cd0000 rwxp 00000000 00:00 0
    a5cd0000-a5e30000 rwxp 00000000 00:00 0
    a5e30000-ae750000 rwxp 00000000 00:00 0
    ae750000-aef50000 rwxp 00000000 00:00 0
    aef50000-b2750000 rwxp 00000000 00:00 0
    b2756000-b275a000 rwxp 00000000 00:00 0
    b275a000-b27d6000 rwxp 00000000 00:00 0
    b27d6000-b28b6000 rwxp 00000000 00:00 0
    b28b6000-b47d6000 rwxp 00000000 00:00 0
    b47d6000-b5045000 r-xs 00000000 03:01 1112048    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/charsets.jar
    b5045000-b505a000 r-xs 00000000 03:01 1112076    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/jce.jar
    b505a000-b50df000 r-xs 00000000 03:01 1112077    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/jsse.jar
    b50df000-b5148000 rwxp 00000000 00:00 0
    b5148000-b7757000 r-xs 00000000 03:01 1112084    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/rt.jar
    b7757000-b7766000 r-xp 00000000 03:01 1145170    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libzip.so
    b7766000-b7768000 rwxp 0000e000 03:01 1145170    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libzip.so
    b7768000-b7789000 r-xp 00000000 03:01 1145150    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libjava.so
    b7789000-b778b000 rwxp 00020000 03:01 1145150    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libjava.so
    b778b000-b7796000 r-xp 00000000 03:01 1145169    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libverify.so
    b7796000-b7797000 rwxp 0000b000 03:01 1145169    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/libverify.so
    b7797000-b77a0000 r-xp 00000000 03:01 10759656   /lib/libnss_files-2.5.so
    b77a0000-b77a1000 r-xp 00008000 03:01 10759656   /lib/libnss_files-2.5.so
    b77a1000-b77a2000 rwxp 00009000 03:01 10759656   /lib/libnss_files-2.5.so
    b77a2000-b77a4000 r-xs 00000000 03:01 1145124    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/ext/dnsns.jar
    b77a4000-b77ac000 rwxs 00000000 03:01 1014834    /tmp/hsperfdata_oracle/2854
    b77ac000-b7b1c000 r-xp 00000000 03:01 1145177    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/client/libjvm.so
    b7b1c000-b7b3a000 rwxp 00370000 03:01 1145177    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/client/libjvm.so
    b7b3a000-b7f52000 rwxp 00000000 00:00 0
    b7f53000-b7f59000 r-xp 00000000 03:01 1145187    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/native_threads/libhpi.so
    b7f59000-b7f5a000 rwxp 00006000 03:01 1145187    /tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/native_threads/libhpi.so
    b7f5a000-b7f5b000 rwxp 00000000 00:00 0
    b7f5b000-b7f5c000 r-xp 00000000 00:00 0
    b7f5c000-b7f5d000 rwxp 00000000 00:00 0
    b7f5d000-b7f5e000 r-xp 00000000 00:00 0          [vdso]
    bfb6e000-bfb71000 ---p 00000000 00:00 0
    bfb71000-bfd6e000 rwxp 00000000 00:00 0          [stack]
    VM Arguments:
    jvm_args: -Doracle.installer.library_loc=/tmp/OraInstall2009-08-10_06-53-41PM/oui/lib/linux -Doracle.installer.oui_loc=/tmp/OraInstall2009-08-10_06-53-41PM/oui -Doracle.installer.bootstrap=TRUE -Doracle.installer.startup_location=/usr/local/oracle/database/install -Doracle.installer.jre_loc=/tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre -Doracle.installer.nlsEnabled="TRUE" -Doracle.installer.prereqConfigLoc=  -Doracle.installer.unixVersion=2.6.30.4-09-AUG-2009-V02 -Xmx150m
    java_command: oracle.sysman.oii.oiic.OiicInstaller -scratchPath /tmp/OraInstall2009-08-10_06-53-41PM -sourceLoc /usr/local/oracle/database/install/../stage/products.xml -sourceType network -timestamp 2009-08-10_06-53-41PM -responseFile /usr/local/oracle/database/responseFileV01.rsp -silent
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=
    CLASSPATH=
    PATH=/usr/bin:/usr/ccs/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/usr/local/oracle/app/oracle/product/11.1.0/db_1/bin:/usr/local/java/jdk1.6.0_15/bin:/home/oracle/bin:/usr/local/oracle/app/oracle/product/11.1.0/db_1/bin:/usr/local/java/jdk1.6.0_15/bin:/usr/local/oracle/database/install
    LD_LIBRARY_PATH=/tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386/client:/tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/lib/i386:/tmp/OraInstall2009-08-10_06-53-41PM/jdk/jre/../lib/i386
    SHELL=/bin/bash
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x32a000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGBUS: [libjvm.so+0x32a000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGFPE: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGPIPE: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGILL: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x290460], sa_mask[0]=0x00000000, sa_flags=0x10000004
    SIGHUP: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGINT: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGQUIT: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGTERM: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    ---------------  S Y S T E M  ---------------
    OS:Red Hat Enterprise Linux Server release 5.3 (Tikanga)
    uname:Linux 2.6.30.4-09-AUG-2009-V02 #1 SMP Sun Aug 9 19:19:38 CEST 2009 i686
    libc:glibc 2.5 NPTL 2.5
    rlimit: STACK 8192k, CORE 0k, NPROC 2047, NOFILE 65536, AS infinity
    load average:0.12 0.03 0.01
    CPU:total 1 (cores per cpu 1, threads per core 1) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 1137164k(322240k free), swap 2047k(2047k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for linux-x86, built on Dec 15 2006 02:25:41 by java_re with gcc 3.2.1-7a (J2SE release)
    [root@ccsaplinux0002 oracle]#

  • Full GC bug with JVM 1.5.0

    Hi people,
    Since we switched from JRE 1.5.0_08 to 1.5.0_11_64, we are encountering application freezes due to infinite full GC loops.
    Sun mentionned this runtime problem as bug 6545719 (*http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6545719*) since jre 1.5.0_11 fixed in version 1.5.0_15.
    I asbolutely need to reproduce the bug before we switch to jre 1.5.0_15. The problem is that i can't find the PermLeak.java class mentionned in the URL above.
    Can anybody tell me how/where can i get this class?
    Thanx in advance

    The test case was submitted by a third party, so we (Sun) need approval to release it. It's easier to describe how to write your own test. Use an infinite loop that appends to a string variable s and then calls s.intern() on each iteration. You want s to fill the permanent generation (default 64MB), so best to grow it quickly. You also need to use s somewhere in the loop, by printing out part of it, or printing its length. Otherwise if the method is compiled it might get optimized away. Good luck.
    -John

  • Investigation on JVM crash without core dump (by JIT compiler)

    Hi, All
    I posted "JVM crash without core dump due to CompilerThread1" couple months ago.
    http://forum.java.sun.com/thread.jspa?threadID=5253434
    I would like show what we found, and ask couple questions
    1) The reason of JVM crash is "CompilerThread0/1 wanted to allocate more native memory and eventually exceeded the limit of 32-bit Linux (on Redhat, the limit of VIRT is 3G)
    2) After we lower the heap size (to reduce process size) and added process size monitor (track process size every minute) and JIT compilation log (-XX:+PrintCompilation),
    We found sometimes JVM process jumped more than 800M when compiling one method. with the following log
    Total time for which application threads were stopped: 0.1997400 seconds
    5828 xxx.xxx.SomeClass::someMethod (1507 bytes)
    5828 COMPILE SKIPPED: out of nodes during split (not retryable)
    549002.449: [GC [PSYoungGen: 517897K->28390K(551296K)] 942855K->453348K(1229952K), 0.0726350 secs]
    if we saw "COMPILE SKIPPED: out of nodes during split (not retryable)", the process size of JVM (VIRT/RES) always jumped 800M~1000M, and sometimes the memory get reverted in 30mins to couple hours, and sometimes it lasted forever. (so before we have larger footprint, this jump will kill JVM, right now, if the jump lasts forever, any more allocation on top of it also can kill jvm (much rare))
    3) This is definitely a bug of JVM, because
    it only happened on server mode, not client mode
    it is random, that method can be compiled success on other JVM or next restart (we have 20 JVMs)
    the method is not that complicate, like 100 lines, (bigger method gets compiled success)
    this only happen on PROD environment, we can't reproduce it locally or QA (the method is always compiled success)
    It mostly like under some condition (maybe node space is not enough), to compile that method will trigger JVM trying to allocate much more native memory.
    4) We are going to disable this method by ".hotspot_compiler" to fix it, right now we are using lower footprint, JVM dies rarely.
    +To understand more about this, I have some questions about JIT compiling+
    I saw same method are compiled more than once from JIT log, like the method caused our problem, it only happens on 2nd time compilation.
    Is it that JIT compiler will recompile the method with deeper optimization level some time, and more optimization it uses, the more memory it requires?
    (like gcc has -O2 -O3)
    Thanks!
    Neo

    Today, one JVM crashed again, with
    {Heap before gc invocations=4188:
    PSYoungGen      total 540864K, used 487958K [0x8ba50000, 0xb1250000, 0xb1250000)
      eden space 467328K, 100% used [0x8ba50000,0xa82b0000,0xa82b0000)
      from space 73536K, 28% used [0xa82b0000,0xa96d5850,0xaca80000)
      to   space 71680K, 0% used [0xacc50000,0xacc50000,0xb1250000)
    ParOldGen       total 1024000K, used 493477K [0x4d250000, 0x8ba50000, 0x8ba50000)
      object space 1024000K, 48% used [0x4d250000,0x6b439610,0x8ba50000)
    PSPermGen       total 101760K, used 101240K [0x2d250000, 0x335b0000, 0x4d250000)
      object space 101760K, 99% used [0x2d250000,0x3352e1f8,0x335b0000)
    405290.711: [GC [PSYoungGen: 487958K->17397K(544192K)] 981435K->518248K(1568192K), 0.0769350 secs]
    Heap after gc invocations=4188:
    PSYoungGen total 544192K, used 17397K [0x8ba50000, 0xb1250000, 0xb1250000)
    eden space 472512K, 0% used [0x8ba50000,0x8ba50000,0xa87c0000)
    from space 71680K, 24% used [0xacc50000,0xadd4d480,0xb1250000)
    to space 70208K, 0% used [0xa87c0000,0xa87c0000,0xacc50000)
    ParOldGen total 1024000K, used 500851K [0x4d250000, 0x8ba50000, 0x8ba50000)
    object space 1024000K, 48% used [0x4d250000,0x6bb6cf70,0x8ba50000)
    PSPermGen total 101760K, used 101240K [0x2d250000, 0x335b0000, 0x4d250000)
    object space 101760K, 99% used [0x2d250000,0x3352e1f8,0x335b0000)
    Total time for which application threads were stopped: 0.0779620 seconds
    Exception in thread "CompilerThread1" java.lang.OutOfMemoryError: requested 4522768 bytes for Chunk::new. Out of swap space?

  • Non-heap memory area spring leak  in JVM 1.50_6

    Please let me question though it doesn't understand be good from this topic.
    A problem occurs when testing as follows.
    The problem is to generate memory leak in non-heap area.
    %java CconnectTest2 129.24.34.68 130.104.10.50 6101 5000 185000 100
    (%java -server CconnectTest2 source-ipaddress destination-ipaddress src-port dst-port thread-count)
    CconnectTest2.java
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.InetSocketAddress;
    import java.net.Socket;
    import java.net.SocketAddress;
    import java.net.SocketTimeoutException;
    import java.net.UnknownHostException;
    import java.nio.channels.IllegalBlockingModeException;
    import java.util.Calendar;
    public class CconnectTest2 {
         * @param bind_ip connect_ip connect_port wait_cntconnect_TIMEOUT thread_cnt
         public static void main(String[] args) {
              if ((args[0].equals("")) || (args[0]==null)) {
         System.err.println("bind_ip*");
         return ;
              if ((args[1].equals("")) || (args[1]==null)) {
         System.err.println("connect_ip*");
         return ;
              if ((args[2].equals("")) || (args[2]==null)) {
         System.err.println("connect_port*");
         return ;
              if ((args[3].equals("")) || (args[3]==null)) {
         System.err.println("wait_cnt*");
         return ;
              if ((args[4].equals("")) || (args[4]==null)) {
         System.err.println("connect_TIMEOUT*");
         return ;
              if ((args[5].equals("")) || (args[5]==null)) {
         System.err.println("thread_cnt*");
         return ;
    String bind_ip          =args[0];
    String connect_ip     =args[1];
    int connect_port     =Integer.parseInt(args[2]);
    int wait_cnt          =Integer.parseInt(args[3]);
    int connect_TIMEOUT     =Integer.parseInt(args[4]);
    int thread_cnt          =Integer.parseInt(args[5]);
    System.out.println("bind_ip="+bind_ip);
    System.out.println("connect_ip="+connect_ip);
    System.out.println("connect_port="+connect_port);
    System.out.println("wait_cnt="+wait_cnt);
    System.out.println("connect_TIMEOUT="+connect_TIMEOUT);
    System.out.println("thread_cnt="+thread_cnt);
    int i=0;
    while( true ){
    i++;
    if( i<= thread_cnt){
         ConnectExe a = new ConnectExe(connect_ip,bind_ip,connect_port,connect_TIMEOUT,wait_cnt) ;
    a.start() ;
    try {
    Thread.sleep( 1000 ) ;
    } catch (InterruptedException ex) {
         System.out.println("thread_start[ "+i+"]");
    } else {
    System.out.println("thread_start OK"+thread_cnt);
         break ;
    while( true ){
    System.gc() ;
    try {
    Thread.sleep( 20000 ) ;
    } catch (InterruptedException ex) {
    int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY) ;
    int min = Calendar.getInstance().get(Calendar.MINUTE) ;
    int sec = Calendar.getInstance().get(Calendar.SECOND) ;
    Runtime run = Runtime.getRuntime();
    long freesize = 0 ;
    freesize = (run.maxMemory()-run.totalMemory())+run.freeMemory() ;
    if( freesize > 0 ){
    freesize = freesize/1024 ;
    System.out.println( "" + hour + ":" + min + ":" + sec
              + " HeepFreeSize:"+ freesize + " K"
    + " activeThread:" + Thread.activeCount() ) ;
    static public class ConnectExe extends Thread{
    String      serverAddress=null;
    String      bindip=null;
    int          port=6100;
    int          timeout=0;
    int          wait_cnt=0;
    public ConnectExe(String ne,String bind,int connect_port,int timeout,int wait_cnt ){
         this.serverAddress           = ne ;
    this.bindip                = bind ;
    this.port                     = connect_port ;
    this.timeout               = timeout;
    this.wait_cnt               = wait_cnt;
    public void run(){
    while( true ){
         SocketAddress socketAddress = null;
         Socket socket = null;
         try {
              socket = new Socket();
              socket.setKeepAlive(true);
              byte[] ip = InetAddress.getByName(this.serverAddress).getAddress();
              InetAddress addr = InetAddress.getByAddress(this.serverAddress, ip);
              if (bindip == null) {
                   socketAddress = new InetSocketAddress(addr, this.port);
              } else {
                   socketAddress = new InetSocketAddress(addr, this.port);
                   SocketAddress bindAddress = new InetSocketAddress(this.bindip, socket.getPort());
                   socket.bind(bindAddress);
              System.out.println( "connect:" + this.serverAddress ) ;
              socket.connect(socketAddress, this.timeout);
              socket.close();
              System.out.println( "close :" + this.serverAddress ) ;
              socket = null;
         } catch (UnknownHostException e) {
              System.out.println("This socket cannot be connected with the server(UnknownHostException) " + e.getMessage() ) ;
              if (socket != null) {
                   try {
                        socket.close();
                   } catch (IOException e1) {
                        System.out.println( e1.getMessage() ) ;
                   socket                = null;
                   socketAddress      = null;
         } catch (SocketTimeoutException e) {
              System.out.println("This socket cannot be connected with the server (SocketTimeoutException) " + e.getMessage() ) ;
              if (socket != null) {
                   try {
                        socket.close();
                   } catch (IOException e1) {
                        System.out.println( e1.getMessage() ) ;
                   socket                = null;
                   socketAddress      = null;
         } catch (IllegalBlockingModeException e) {
              System.out.println("This socket cannot be connected with the server (IllegalBlockingModeException) " + e.getMessage() ) ;
              if (socket != null) {
                   try {
                        socket.close();
                   } catch (IOException e1) {
                        System.out.println( e1.getMessage() ) ;
                   socket                = null;
                   socketAddress      = null;
         } catch (IllegalArgumentException e) {
              System.out.println("This socket cannot be connected with the server (IllegalArgumentException) " + e.getMessage() ) ;
              if (socket != null) {
                   try {
                        socket.close();
                   } catch (IOException e1) {
                        System.out.println( e1.getMessage() ) ;
                   socket                = null;
                   socketAddress      = null;
         } catch (IOException e) {
              System.out.println("This socket cannot be connected with the server (IOException) " + e.getMessage() ) ;
              if (socket != null) {
                   try {
                        socket.close();
                   } catch (IOException e1) {
                        System.out.println( e1.getMessage() ) ;
                   socket                = null;
                   socketAddress      = null;
         } catch (Exception e) {
         System.out.println("This socket cannot be connected with the server (Exception) " + e.getMessage() ) ;
         if (socket != null) {
              try {
                   socket.close();
              } catch (IOException e1) {
                   System.out.println( e1.getMessage() ) ;
              socket                = null;
              socketAddress      = null;
    try {
                             Thread.sleep( this.wait_cnt ) ;
                        } catch (InterruptedException e) {
    It leaks gradually when executing it for a long time.
    It makes the generation of the memory leak disregarding timeout error of the
    connection a problem.
    Is this a bug of JVM?
    Or, is it a problem of coding?
    Environment:
    JVM Sun JVM 1.5.0_6
    OS RedHat Enterprise Linux ES 3 update6 (kernel 2.4.21-37ELsmp)

    I was searching on Google for "java Calendar memory leak", and I ran across this post. Now, I haven't examined your code but I do see you make a lot of calls to getInstance() in java.util.Calendar, and I am having the same kind of issue as you are describing. So I took the Calendar class out (no more getInstances) and now the memory is still increasing but at a MUCH slower rate, and the CPU time is down drastically. I do not know if this is the cause because I haven't seen it documented, but it would be great if someone could confirm this for me. Maybe try removing the Calendar getInstances and find another way to do it, like using System.getCurrentMillis and working from there to get the hours (that's what I did.)
    Hope this helps,
    Elijah

  • Solaris 10, amd64, JVM crash at short time after startup

    Hi All,
    I have an application which allocate 10G of memory for his Heap, run on 4 dual core amd64 CPUs, 16G RAM machine and crash in 98% of the cases at short time after startup. This is a customer machine.
    I have a similar machine for tests with only 2 dual core amd64 CPU and 12G RAM and I don't experience any crashes running application with similar configuration, similar version of JDK and similar input data.
    I have tried with different GC algorithms, but we obtain crashes sonner or later. I rare cases when application manage to start seems that CMS offer the greatest performance.
    There is a bug in JVM? Knows anybody an workaround for this?
    # An unexpected error has been detected by Java Runtime Environment:
    # SIGSEGV (0xb) at pc=0xfffffd7ffebbdb33, pid=21678, tid=5
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_03-b05 mixed mode)
    # Problematic frame:
    # V [libjvm.so+0x5bdb33]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x000000000042e000): GCTaskThread [id=5]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000000000000a8
    Registers:
    RAX=0x0000000000000000, RBX=0x0000000000000002, RCX=0x0000000000000000, RDX=0x0000000000000000
    RSP=0xfffffd7ffad37800, RBP=0xfffffd7ffad37830, RSI=0x0000000000000000, RDI=0x00000000004e6790
    , R8=0x0000000000000000, R9=0x0000000000000002, R10=0x0000000000000000, R11=0xfffffd7d7bddd058, R12=0x00000000004e6790, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x0000000000429650
    RIP=0xfffffd7ffebbdb33, RFLAGS=0x0000000000010246
    Top of Stack: (sp=0xfffffd7ffad37800)
    0xfffffd7ffad37800: fffffd7fff1051c8 000000000042a1f0
    0xfffffd7ffad37810: fffffd7d72bd05a0 0000000000000000
    0xfffffd7ffad37820: fffffd7d72bd05a0 0000000000000001
    0xfffffd7ffad37830: fffffd7ffad37840 fffffd7ffebcfdd1
    0xfffffd7ffad37840: fffffd7ffad37cc0 fffffd7ffee8953b
    0xfffffd7ffad37850: fffffd7d72bd05a0 0000000000000001
    0xfffffd7ffad37860: 000000000042a370 000000000042e000
    0xfffffd7ffad37870: 0000000000000002 0000000000000000
    0xfffffd7ffad37880: 0000000000000000 0000000000422e80
    0xfffffd7ffad37890: 000000000042c120 000000000042e320
    0xfffffd7ffad378a0: 000000000042e330 000000000042e708
    0xfffffd7ffad378b0: 000000000042e000 0000000000424180
    0xfffffd7ffad378c0: 000000000042e720 000000000042e730
    0xfffffd7ffad378d0: 000000000042eb08 00000000004241c0
    0xfffffd7ffad378e0: 00000000004224a0 0000000000000000
    0xfffffd7ffad378f0: 0000000000000000 0000000000000000
    0xfffffd7ffad37900: 0000000000000000 0000000000000400
    0xfffffd7ffad37910: fffffd7d7a92c5f8 fffffd7d7a92c5f8
    0xfffffd7ffad37920: fffffd7d7a92c5f8 fffffd7d7a92c5f8
    0xfffffd7ffad37930: 0000000000000000 0000000000000000
    0xfffffd7ffad37940: 0000000000000000 0000000000038800
    0xfffffd7ffad37950: 0000000000000479 0000000000000000
    0xfffffd7ffad37960: 0000000000000000 0000000000000000
    0xfffffd7ffad37970: 0000000000000000 fffffd7ffad37b10
    0xfffffd7ffad37980: fffffd7ffad37b58 fffffd7ffad37ba0
    0xfffffd7ffad37990: fffffd7ffad37c30 0000000000430240
    0xfffffd7ffad379a0: 0000000000429650 fffffd7d7a930000
    0xfffffd7ffad379b0: 000000026ed7667f 0000000000000000
    0xfffffd7ffad379c0: 000000000003a890 0000000000000000
    0xfffffd7ffad379d0: 0000000000000000 0000000000000000
    0xfffffd7ffad379e0: 0000000000000000 0000000000000000
    0xfffffd7ffad379f0: 0000000000000000 0000000000000000
    Instructions: (pc=0xfffffd7ffebbdb33)
    0xfffffd7ffebbdb23: 24 20 4c 8b 44 24 20 4d 89 03 eb 18 4d 8b 43 08
    0xfffffd7ffebbdb33: 4d 8b 80 a8 00 00 00 4c 89 44 24 28 4c 8b 44 24
    Stack: [0x0000000000000000,0x0000000000000000), sp=0xfffffd7ffad37800, free space=1610527966k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [libjvm.so+0x5bdb33]
    V [libjvm.so+0x5cfdd1]
    V [libjvm.so+0x88953b]
    V [libjvm.so+0x98e8a6]
    V [libjvm.so+0x98e799]
    V [libjvm.so+0x87b18c]
    C [libc.so.1+0xcb34b] thrslot_offset+0x31b
    C [libc.so.1+0xcb580] thrslot_offset+0x550
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x0000000000a6b400 JavaThread "Timer-0" [_thread_blocked, id=19]
    0x0000000000743400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=17]
    0x0000000000742000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=16]
    0x0000000000740c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=15]
    0x000000000072c400 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=14]
    0x0000000000729800 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=13]
    0x000000000071c400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=12]
    0x000000000071b800 JavaThread "Surrogate Locker Thread (CMS)" daemon [_thread_blocked, id=11]
    0x00000000006f3000 JavaThread "Finalizer" daemon [_thread_blocked, id=10]
    0x00000000006f2800 JavaThread "Reference Handler" daemon [_thread_blocked, id=9]
    0x0000000000428400 JavaThread "main" [_thread_blocked, id=2]
    Other Threads:
    0x00000000006ee400 VMThread [id=8]
    0x0000000000744c00 WatcherThread [id=18]
    VM state:at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
    [0x00000000004273a0/0x0000000000427400] Threads_lock - owner thread: 0x00000000006ee400
    [0x0000000000423500/0x0000000000427b10] Heap_lock - owner thread: 0x0000000000428400
    Heap
    par new generation total 74560K, used 63936K [0xfffffd7d75600000, 0xfffffd7d7a930000, 0xfffffd7d7a930000)
    eden space 63936K, 100% used [0xfffffd7d75600000, 0xfffffd7d79470000, 0xfffffd7d79470000)
    from space 10624K, 0% used [0xfffffd7d79470000, 0xfffffd7d79470000, 0xfffffd7d79ed0000)
    to space 10624K, 100% used [0xfffffd7d79ed0000, 0xfffffd7d7a930000, 0xfffffd7d7a930000)
    concurrent mark-sweep generation total 10400576K, used 29146K [0xfffffd7d7a930000, 0xfffffd7ff5600000, 0xfffffd7ff5600000)
    concurrent-mark-sweep perm gen total 21248K, used 6589K [0xfffffd7ff5600000, 0xfffffd7ff6ac0000, 0xfffffd7ffaa00000)
    Dynamic libraries:
    0x0000000000400000      /export/home/tg/jre1.6.0_03/bin/amd64/java
    0xfffffd7fff380000      /lib/64/libthread.so.1
    0xfffffd7fff360000      /export/home/tg/jre1.6.0_03/bin/amd64/../../lib/amd64/jli/libjli.so
    0xfffffd7fff390000      /lib/64/libdl.so.1
    0xfffffd7fff240000      /lib/64/libc.so.1
    0xfffffd7ffe600000      /export/home/tg/jre1.6.0_03/lib/amd64/server/libjvm.so
    0xfffffd7fff1e0000      /lib/64/libsocket.so.1
    0xfffffd7fff340000      /usr/lib/64/libsched.so.1
    0xfffffd7fff1a0000      /lib/64/libm.so.1
    0xfffffd7fff170000      /usr/lib/64/libCrun.so.1
    0xfffffd7fff140000      /lib/64/libdoor.so.1
    0xfffffd7ffe530000      /lib/64/libnsl.so.1
    0xfffffd7ffe4b0000      /lib/64/libm.so.2
    0xfffffd7ffe470000      /lib/64/libscf.so.1
    0xfffffd7ffe440000      /lib/64/libuutil.so.1
    0xfffffd7ffe420000      /lib/64/libmd5.so.1
    0xfffffd7ffe3f0000      /lib/64/libmp.so.2
    0xfffffd7ffe270000      /export/home/tg/jre1.6.0_03/lib/amd64/native_threads/libhpi.so
    0xfffffd7ffe210000      /export/home/tg/jre1.6.0_03/lib/amd64/libjdwp.so
    0xfffffd7ffe1e0000      /export/home/tg/jre1.6.0_03/lib/amd64/libnpt.so
    0xfffffd7ffe190000      /usr/lib/iconv/amd64/UTF-8%646.so
    0xfffffd7ffe160000      /usr/lib/iconv/amd64/646%UTF-8.so
    0xfffffd7ffe110000      /export/home/tg/jre1.6.0_03/lib/amd64/libverify.so
    0xfffffd7ffe0c0000      /export/home/tg/jre1.6.0_03/lib/amd64/libjava.so
    0xfffffd7ffe080000      /export/home/tg/jre1.6.0_03/lib/amd64/libzip.so
    0xfffffd7ffe010000      /export/home/tg/jre1.6.0_03/lib/amd64/libdt_socket.so
    0xfffffd7d75460000      /lib/64/nss_files.so.1
    VM Arguments:
    jvm_args: -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dapp.dir=/opt/tg/cos-deploy-0.35/bin/.. -Dlog.dir=log -Dapp.name=process -Detc.dir=/opt/tg/cos-deploy-0.35/bin/../etc -Dconfig.file=/opt/tg/cos-deploy-0.35/bin/../etc/process.properties -Dlog4j.configuration=etc/log4j.xml -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Xms10G -Xmx10G
    java_command: tg.cos.server.Main
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=/export/home/tg/jre1.6.0_03
    PATH=/opt/tg/fcs-foundation/perl/bin:/opt/tg/fcs-foundation/perl/bin:/sbin:/usr/sbin:/usr/sfw/bin:/opt/sfw/bin:/usr/X/bin:/usr/ccs/bin:/usr/local/bin:/usr/bin:/usr/sbin:/export/home/oracle_install/product/client/10.2/bin:/opt/tg/POOL/bin:/opt/tg/MailSender/bin:/export/home/tg/bin:/usr/sbin:/export/home/oracle_install/product/client/10.2/bin:/opt/tg/POOL/bin:/opt/tg/MailSender/bin
    LD_LIBRARY_PATH=/export/home/tg/jre1.6.0_03/lib/amd64/server:/export/home/tg/jre1.6.0_03/lib/amd64:/export/home/tg/jre1.6.0_03/../lib/amd64
    SHELL=/bin/bash
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x9883b0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGBUS: [libjvm.so+0x9883b0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGFPE: [libjvm.so+0x315b10], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGPIPE: [libjvm.so+0x315b10], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGILL: [libjvm.so+0x315b10], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGHUP: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGINT: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGQUIT: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGTERM: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGQUIT: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGTERM: [libjvm.so+0x87ca80], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIG39: [libjvm.so+0x87f4d0], sa_mask[0]=0x00000000, sa_flags=0x00000008
    SIG40: [libjvm.so+0x315b10], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    --------------- S Y S T E M ---------------
    OS: Solaris 10 11/06 s10x_u3wos_10 X86
    Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 14 November 2006
    uname:SunOS 5.10 Generic_118855-33 i86pc (T2 libthread)
    rlimit: STACK 10240k, CORE infinity, NOFILE 65536, AS infinity
    load average:3.72 3.68 3.23
    CPU:total 8 (2 cores per cpu, 1 threads per core) family 15 model 65 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, mmxext, 3dnow, 3dnowext
    Memory: 4k page, physical 16775096k(1672236k free)
    vm_info: Java HotSpot(TM) 64-Bit Server VM (1.6.0_03-b05) for solaris-amd64, built on Sep 24 2007 22:29:24 by "" with unknown Workshop:0x580
    I created a small test which somehow emulate the real application and I obtain the same results: on test machine run without any issues on live machine it crashes all the time.
    What can be the cause?
    import java.util.*;
    public class MemoryTest {
         private List<Page> pages = new LinkedList<Page>();
         public void initTest() {
              int counter = 1;
              while( canAddOneMorePage() ) {
                   Page page = new Page(counter, (byte)counter++);
                   pages.add(page);
         private boolean canAddOneMorePage() {
              boolean result = true;
              long freeMem = Runtime.getRuntime().freeMemory() / (1024*1024) ;
              if (freeMem < 512) {
                   result = false;
              return result;
         private boolean validatePages() {
              boolean arePagesValid = true;
              for(Page p : pages) {
                   boolean isPageValid = p.isValid();
                   if ( !isPageValid ) {
                        System.out.println("Page "+p.id+ " contains corrupted data");
                        arePagesValid = false;
              return arePagesValid;
         private void updatePages(byte value) {
              for(Page p : pages) {
                   p.updateValues(value);
         public void runTest() {
              int TESTS_NUM = 100;
              System.out.println("There are "+pages.size()+" pages.");
              System.out.println("Currently the pages "+ (validatePages() ? "contain no errors" : "contain errors"));
              for(int i=1; i<TESTS_NUM; i++) {
                   System.out.println("Test "+i+" of "+TESTS_NUM);
                   updatePages((byte)i);
                   validatePages();
         public static void main(String[] args) {
              MemoryTest main = new MemoryTest();
              main.initTest();
              main.runTest();
    class Page {
         public static final int LENGTH = 1024*1024;
         List <byte[]> list;
         public byte value = 0;
         public int id;
         public Page(int id, byte value) {
              this.list = new LinkedList<byte[]>();
              this.value = value;
              this.id = id;
              for(int i=0; i<LENGTH; i++) {
                   byte[] data = new byte [512];
                   for( int j=0; j<512; j++) {
                        data[j] = value;
                   list.add(data);
         public void updateValues(byte value) {
              this.value = value;
              this.list = new LinkedList<byte[]>();
              System.out.println("Updating page "+id);
              for(int i=0; i<LENGTH; i++) {
                   byte[] data = new byte [512];
                   for( int j=0; j<512; j++) {
                        data[j] = value;
                   list.add(data);
         public boolean isValid() {
              boolean result = true;
              for( byte[] data: list) {
                   for( byte b : data) {
                        if (value != b) {
                             result = false;
                             break;
                   if ( !result ) {
                        break;
              return result;
    }Edited by: blue67 on Dec 10, 2007 12:57 AM

    I've experienced the same crash problem for my application in a Sun Fire x4600 M2..
    My application which allocates 50G of memory for his Heap, runs on 8 quad core amd64 CPUs, 64G RAM machine and crash in 98% of the cases at short time after startup.
    If I run my application on a different machine, for example a Sun Fire 280R with 2 CPUs UltraSPARC-III+ 1.2Ghz 8MB, there are no crashes.
    I think the problem is related to the AMD 64 bits CPU architecture.
    I filed a bug to the Sun Bug DB with ID 1415527, but it hasn't been published yet.
    I cannot understand why, since it seems to be a problem common also to other users.
    Here's part of my last hs_err_pidXXX.log file:
    # An unexpected error has been detected by Java Runtime Environment:
    # SIGSEGV (0xb) at pc=0xfffffd7ffebbd0bd, pid=25799, tid=50
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b16 mixed mode solaris-amd64)
    # Problematic frame:
    # V [libjvm.so+0x5bd0bd]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    T H R E A D
    Current thread (0x0000000000b21c00): GCTaskThread [stack: 0x0000000000000000,0x0000000000000000] [id=50]
    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0xfffffd7ffebbd0bd
    Registers:
    RAX=0x0000000000000000, RBX=0x0000000000000008, RCX=0x0000000000000002, RDX=0xfffffd73b56f1ce8
    RSP=0xfffffd73b56f1cb0, RBP=0xfffffd73b56f1e00, RSI=0xfffffd7c55dd2f08, RDI=0xfffffd7c55dd2bb9
    , R8=0xb000000000000000, R9=0x0000000000c38ff0, R10=0x00000000042d0e97, R11=0xfffffd7c55dd2d88, R12=0x0000000000b38f00, R13=0x000000000045d070, R14=0x000000000045d070, R15=0x0000000000003c4f
    RIP=0xfffffd7ffebbd0bd, RFLAGS=0x0000000000010246
    Top of Stack: (sp=0xfffffd73b56f1cb0)
    0xfffffd73b56f1cb0: fffffd7fff0f15a8 0000000000000000
    0xfffffd73b56f1cc0: fffffd73b56f1e48 fffffd73b45e0790
    0xfffffd73b56f1cd0: 0000000000000008 fffffd7ffebbc239
    0xfffffd73b56f1ce0: fffffd7fff0f15a8 fffffd7fff0ec260
    0xfffffd73b56f1cf0: 0000000000000000 0000000000b0c5b0
    0xfffffd73b56f1d00: fffffd73fbc00000 000000017fa80000
    0xfffffd73b56f1d10: 0000000000b0c710 0000000000b0c850
    0xfffffd73b56f1d20: 0000000000000000 000000000045d070
    0xfffffd73b56f1d30: 0000000000000000 0000000000b0c850
    0xfffffd73b56f1d40: fffffd73b45e07f8 0000000000b0c8d8
    0xfffffd73b56f1d50: 0000000900b0c5b0 fffffd792b971d60
    0xfffffd73b56f1d60: fffffd7fff103d04 0000441ef1e00000
    0xfffffd73b56f1d70: fffffd7c55dd2f08 fffffd7f00003c4d
    0xfffffd73b56f1d80: fffffd73b45e0790 441f3c4d00000000
    0xfffffd73b56f1d90: 441f3c4d441f3c4d 441f3c4d441f3c4d
    0xfffffd73b56f1da0: 441e3c4d441f3c4d 441f3c4d441e3c4d
    0xfffffd73b56f1db0: 43c03c1e441e3c4d 441e3c4d441e3c4d
    0xfffffd73b56f1dc0: 5e3634bf5e3634bf 10830ae010830ae0
    0xfffffd73b56f1dd0: 036b3673036b3674 036b3673036b3673
    0xfffffd73b56f1de0: 5e3634c05e3634c1 5e3634c05e3634c0
    0xfffffd73b56f1df0: fffffd73b45e0790 00000054b45e0790
    0xfffffd73b56f1e00: fffffd73b56f1eb0 fffffd7ffebbbd47
    0xfffffd73b56f1e10: fffffd73b56f1ef8 0000000000b0ce20
    0xfffffd73b56f1e20: 0000000000b21c00 fffffd7fff04a509
    0xfffffd73b56f1e30: 0000000000000008 00000000ffffffff
    0xfffffd73b56f1e40: fffffd73b56f1e70 0000000000000000
    0xfffffd73b56f1e50: 000002185a539ab2 fffffd7fff103d01
    0xfffffd73b56f1e60: 000000000042c560 0000000000b21e90
    0xfffffd73b56f1e70: 0000000000b21ea0 0000000000b22278
    0xfffffd73b56f1e80: 0000000000b21c00 000000000045a780
    0xfffffd73b56f1e90: 0000000000b22290 0000000000b222a0
    0xfffffd73b56f1ea0: 0000000000b22678 000000000045a7c0
    Thanks

  • Help: Why JVM Crashes?

    I run a complex server app on JDK1.3.0 IBM AIX4.3.3. JVM crashes (process terminates) occasionally after a random period of time e.g. several days. Native code caused SIGILL (illegal instruction) and process was terminated by OS as shown in nuhop.out. (I run it with nohup.)
    BTW, JVM has enough free memory during its running.
    Would anyone tell me possible reasons for JVM crash? Can I say that if JVM crashes, no matter what app it runs, it is a bug of JVM? Need help on locating problem.
    Thanks.

    Can I say that if JVM crashes, no matter what app it
    runs, it is a bug of JVM?No, you cannot. I have seen numerous instances where a JVM brought down the whole process because it caught a signal in some native code outside of the JVM - either in the OS libraries themselves or somewhere else in the programmer's code. In this case since you are getting a SIGILL, the probability of a bug in the OS or the JVM itself seems a bit higher to me than if you just saw, say, SIGSEGV.
    Would anyone tell me possible reasons for JVM crash?Well you probably want to make sure that it is not due to any native code of yours first (or from a 3rd party, like a JDBC driver vendor, for example), if you have any... I find myself answering these kinds of posts often, partially because I have seen this kind of thing numerous times and think that I might be able to help, though it seems some of these questions are asked a little too often...
    Anyway, see this:
    http://forum.java.sun.com/thread.jsp?forum=37&thread=235942
    Good luck.

  • Setup for Discoverer to have multiple sessions opening in different browser

    What is the setup for Discoverer or Windows 6 browser to have multiple discoverer sessions opening in different browser windows at the same time in Discoverer 10g Plus?
    We have implemented Discoverer 10g Plus just to be used as an extract tool. We have some workbooks retrieving 200,000 or more rows from an Oracle database. It is taking 30 to 45 minutes to download. Some users are able to open multiple sessions in different browsers to download more then one worksheet at the time, but we have other users who get an error message that they can only open one session at the time. What is the setup to allow users to open more than one Discoverer session?

    Additional research in Metalink found the following:
    Hdr: 7261918 10.2 USER_JAV 10.1.2.54.25 PRODID-964 PORTID-46
    Abstract: ALLOW ABILITY TO LAUNCH TWO DISCOPLUS SESSIONS FROM SAME BROWSER CONNECTION PAGE
    *** 07/17/08 07:31 am REQUEST TEXT ***
    Please refer to bug 6656139. Need to get Discoverer Plus certified to
    support launching two plus sessions from same browser connections page when
    using SUN JRE 1.5/1.6 or higher.
    As per bug 6656139 it appears to be JVM 1.5.x limitation, because same
    actions work fine when using SUN JRE 1.4.2_xx.
    *** 07/17/08 07:31 am BUSINESS NEED ***
    Impossible to run reports against two different databases simultaniously
    using same Discoverer instace, or just several reports at the same time,
    which would save much time instead of running reports one by one.
    *** 07/19/09 11:57 pm *** (CHG: Sta->97)
    *** 07/19/09 11:57 pm RESPONSE ***
    ALSO SEE THIS FROM SUPPORT
    Error 'Unable To Connect Discoverer Server: Null' When Opening A Second Plus Session From The Same Browser [ID 790187.1]
    Cause
    Bug 6656139, JVM 1.5 : RUNNING TWO PLUS SESSIONS ERRORS WITH UNABLE TO CONNECT: NULL
    The Java Console reports the following error:
    Error: java.lang.StackOverflowError
    java.lang.StackOverflowError
    at java.awt.DefaultFocusTraversalPolicy.accept(Unknown Source)
    at java.awt.ContainerOrderFocusTraversalPolicy.getFirstComponent(Unknown Source)
    at java.awt.ContainerOrderFocusTraversalPolicy.getFirstComponent(Unknown Source)
    at javax.swing.DefaultFocusManager.getFirstComponent(Unknown Source)
    Per Bug 6656139 this problem is a limitation/bug with current Sun JRE 1.5
    and higher and needs to be addressed by Sun.
    Solution
    Currently launching two Discoverer Plus sessions from the same browser connection page is not supported/certified.
    Enhancement Request :
    Bug 7261918, ALLOW ABILITY TO LAUNCH TWO DISCOPLUS SESSIONS FROM SAME BROWSER CONNECTION PAGE
    has been logged for this issue but is still waiting on a Sun Java fix.
    Use the following workaround:
    Use JRE 1.4.2_xx until the ER is implemented and the SUN JRE bug is fixed.

  • Error in generating a new XSL Transformer from large xslt File

    Good day to all,
    Currently I am facing a problem that whenever i try generating a Transformer object from TransformerFactory, I will have a TransformerConfigurationException threw. I have did some research from the net and understand that it is due to a bug that JVM memory limit of 64kb. However is there any external package or project that has already addressed to this problem? I have checked apache but they already patch the problem in Xalan 2.7.1. However I couldn't find any release of 2.7.1
    Please help
    Regards
    RollinMao

    If you have the transformation rules in a separate XSLT file, then, you can use com.icl.saxon package to get XML files transformed. I have used this package with large XSL files and has worked well.

  • ReentrantLock is missing wake signals resulting in a deadlock

    We are hitting an issue with ReentrantLock where it is missing the awake signal resulting in a deadlock. Here is the thread dump for the same. As you can see, Thread-55 is blocked on acquiring the lock, which is not locked by any other thread. This issue is very similar to
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6822370 which happens in Sunspot JVM.
    "Thread-55" id=143 idx=0x2a4 tid=9388 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/ReentrantLock$NonfairSync@0x00000001A21AC9A8
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireInterruptibly(AbstractQueuedSynchronizer.java:867)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1201)[inlined]
    at java/util/concurrent/locks/ReentrantLock.lockInterruptibly(ReentrantLock.java:312)[inlined]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:396)[optimized]
    at java/util/concurrent/ExecutorCompletionService.take(ExecutorCompletionService.java:164)[inlined]
    at com/teneo/esa/common/textengine/expander/StemIndexManager.isStemPresent(StemIndexManager.java:1345)[optimized]
    at com/teneo/esa/common/textengine/expander/StemIndexManager.buildStemIndex(StemIndexManager.java:425)[optimized]
    at com/teneo/esa/common/textengine/expander/StemIndexManager.buildStemIndex(StemIndexManager.java:825)
    at com/teneo/esa/analytics/stemindex/StemIndexAnalyticsImpl.process(StemIndexAnalyticsImpl.java:155)
    at com/teneo/esa/analytics/stemindex/StemIndexAnalyticsService$1.run(StemIndexAnalyticsService.java:128)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-1" id=170 idx=0x310 tid=5524 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-2" id=171 idx=0x314 tid=15588 prio=
    2012-10-04 13:18:37,908 INFO [STDOUT] (RMI TCP Connection(1465)-10.65.59.167:) 5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-3" id=172 idx=0x318 tid=6056 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-4" id=173 idx=0x31c tid=6312 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-5" id=174 idx=0x320 tid=15132 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-6" id=175 idx=0x324 tid=10636 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V
    2012-10-04 13:18:37,908 INFO [STDOUT] (RMI TCP Connection(1465)-10.65.59.167:) (Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-7" id=176 idx=0x328 tid=17820 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    "pool-7-thread-8" id=177 idx=0x32c tid=6516 prio=5 alive, parked, native_blocked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x00000001D2094E90
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)[optimized]
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java/lang/Thread.run(Thread.java:662)
    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
    -- end of trace
    Environment:
    VM Version: Jrockit R28.2.3
    JDK: 1.6.0_31
    OS: Windows 2008
    Let me know if you need any details.
    Thanks,
    Snehal
    Edited by: 957943 on Oct 4, 2012 11:38 AM

    Hi,
    Open a ticket with support to file a BUG with JVM team.
    Or try to upgrade your JVM to avoid this issue.
    Regards,
    Kal

  • PermGen with -server option

    Hello all. I have quite a trouble with JVM:
    We're developing a multimodule web application. Modified wars (=modules) are sent from continuous integration server to our development JBoss many times a day - this redeploys modified WAR. The same for clients - we'd like to redeploy single modules without restarting the server.
    Unfortunately after few redeploys we get PermGen space. Server is useless and must be restarted.
    1) When JVM started with -client option I can avoid PermGen space, but from time to time (~1/10 redeploys), I get this:
    Cause: Class 'org.richfaces.renderkit.html.SuggestionBoxRenderer' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/ajax4jsf/renderkit/compiler/ElementBase$1
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:213)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:196)
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
    I need to restart redeploy. After few redeploys this error repeats.
    A bug in JVM or JBoss, or do I need to add some magical command line options for JVM?
    2) With -server option I still have PermGen space, because JVM doesn't call finalize() methods on objects. Finalization queue is big.
    Is there any JVM option for enabling finalization in -server mode (except manual calling System.runFinalization()), or this is a bug in JVM?
    3) According to -XX:+TraceClassUnloading, JVM unloads unused classes only when PermGen memory is full. Lots of unused classes from WEB-INF/lib are kept in memory for long time. Couldn't this unloading be done earlier?
    Any ideas? My JVM version is 1.6.0_10.

    And another thing I don't understand with -server option. Sometimes instead of throwing PermGen, the application is frozen by GC. But even weak references to some objects aren't removed, for example:
    Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
    class java.lang.reflect.Proxy @ 0x3fd83b8 System Class | 1 | 40 | 120 | 58 504
    '- loaderToCache java.util.WeakHashMap @ 0x8cf8ad8 | 1 | 48 | 120 | 41 312
    '- table java.util.WeakHashMap$Entry[128] @ 0xa2e3fe8 | 1 | 528 | 120 | 41 232
    '- [43] java.util.WeakHashMap$Entry @ 0xa9e0390 | 1 | 40 | 120 | 2 344
    '- referent org.jboss.mx.loading.UnifiedClassLoader3 @ 0xa89a360| 1 | 120 | 120 | 1 636 912
    -----------------------------------------------------------------------------------------------------------------------------------------

  • Performance problem with synchronized singleton

    I'm using the singleton pattern to cache incoming JMS Message data from a 3rd party. I'm seeing terrible performance though, and I think it's because I've misunderstood something.
    My singleton class stores incoming JMS messages in a HashMap, so that successive messages can be checked to see if they are a new piece of data, or an update to an earlier one.
    I followed the traditional examples of a private constructor and a public getInstance method, and applied the double-checked locking to the latter. However, a colleague then suggested that all my other methods in the same class should also be synchronized - is this the case or am I creating an unnecessary performance bottleneck? Or have I unwittingly created that bottleneck elsewhere?
    package com.mycode;
    import java.util.HashMap;
    import java.util.Iterator;
    public class DataCache {
        private volatile static DataCache uniqueInstance;
        private HashMap<String, DataCacheElement> dataCache;
        private DataCache() {
            if (dataCache == null) {
                dataCache = new HashMap<String, DataCacheElement>();
        public static DataCache getInstance() {
             if (uniqueInstance == null) {
                synchronized  (DataCache.class) {
                    if (uniqueInstance == null) {
                        uniqueInstance = new DataCache();
            return uniqueInstance;
        public synchronized void put(String uniqueID, DataCacheElement dataCacheElement) {
            dataCache.put(uniqueID, dataCacheElement);
        public synchronized DataCacheElement get(String uniqueID) {
            DataCacheElement dataCacheElement = (DataCacheElement) dataCache.get(uniqueID);
            return dataCacheElement;
        public synchronized void remove(String uniqueID) {
            dataCache.remove(uniqueID);
        public synchronized int getCacheSize() {
         return dataCache.keySet().size();
         * Flushes all objects from the cache that are older than the
         * expiry time.
         * @param expiryTime (long milliseconds)
        public synchronized void flush(long expiryTime) {
            String uniqueID;
            long currentDate = System.currentTimeMillis();
            long compareDate = currentDate - (expiryTime);
            Iterator<String> iterator = dataCache.keySet().iterator();
            while( iterator.hasNext() ){
                // Get element by unique key
                uniqueID = (String) iterator.next();
                DataCacheElement dataCacheElement = (DataCacheElement) get(uniqueID);
                // get time from element
                long lastUpdatedDate = dataCacheElement.getUpdatedDate();
                // if time is greater than 1 day, remove element from cache
                if (lastUpdatedDate <  compareDate) {
                    remove(uniqueID);
        public synchronized void empty() {
            dataCache.clear();
    }

    m0thr4 wrote:
    SunFred wrote:
    m0thr4 wrote:
    I [...] applied the double-checked locking
    Which is broken. http://www.ibm.com/developerworks/java/library/j-dcl.html
    from the link:
    The theory behind double-checked locking is perfect. Unfortunately, reality is entirely different. The problem with double-checked locking is that there is no guarantee it will work on single or multi-processor machines.
    The issue of the failure of double-checked locking is not due to implementation bugs in JVMs but to the current Java platform memory model. The memory model allows what is known as "out-of-order writes" and is a prime reason why this idiom fails[b].
    I had a read of that article and have a couple of questions about it:
    1. The article was written way back in May 2002 - is the issue they describe relevant to Java 6's memory model? DCL will work starting with 1.4 or 1.5, if you make the variable you're testing volatile. However, there's no reason to do it.
    Lazy instantiation is almost never appropriate, and for those rare times when it is, use a nested class to hold your instance reference. (There are examples if you search for them.) I'd be willing to be lazy instantiation is no appropriate in your case, so you don't need to muck with syncing or DCL or any of that nonsense.

  • ReportViewerBean popup dialogs not located correctly

    When invoking ReportViewerBean.exportView, the confirmation dialog after export completion is located at the top-left of the screen. Is there a fix / workaround for this problem?
    The same problem occurs when invoking the standard Export and Print buttons on the toolbar.

    I'm not aware of any recent bugs with JVM 1.6.x - there were some way back in 1.2/1.3.
    The Print Dialog - it's the standard Java one - shouldn't be centered.  The export dialog should.
    Quick test - the ReportViewerBean is located in the CrystalReportsRuntime.jar. 
    Put all the 12.x jars in the classpath, and execute:
    java com.crystaldecisions.ReportViewer.ReportViewerFrame
    make sure the "Crystal Reports 2008" appears on the top right corner, then select "All Files" then a rpt with saved data. 
    Does the bare ReportViewerBean in a JFrame exibit the same behavior?
    If so, then there's some issue with your environment.
    If not, then I'd go to your project and introspect the JSwing hierarchy - there's something causing the parent frame location to be zeroed, from the JDialog perspective.
    Sincerely,
    Ted Ueda

Maybe you are looking for

  • Data transfer from mac to pc using ipod

    I need to transfer some data files from my MacBook to my PC using my 30GB ipod. I get all the files copied onto my ipod from my mac with no problems. I have my ipod set to be used in disk mode. Once I plug it into my pc, it tells me that I need to fo

  • Phone just turned off on its own?

    Hello My phone ws fully charged and it just turned off. It wouldnt turn on again with just the top power button. I had to hold the home button and the top button and it worked. Is this a fault that i should talk to Apple about as im worried it will d

  • How to compile forms in a UNIX CLI?

    Can anybody tell me how to compila a form in UNIX with Oracle 6 or 6i? I know I have to use the 'f60gen' or 'f60genm' commands, but I don't know witch arguments I have to use. Thanks in advance, Pablo.

  • How to use 'right click' command of windows in mac firefox

    how do i use the windows 'right click commands in mac firefox == This happened == Every time Firefox opened == begining

  • Can I live without asmlib in Linux ?

    Platform : RHEL 5(64 bit) Grid Version: 11.2.0.3 I have only worked in Solaris and AIX before. I've done several RAC installations in Solaris/AIX. Our company has decided to move some of our RAC implementations to Linux because of the costs. From goo