Hi Jerome et al,

I tried to configure Hotspot as indicated by Mark. In my case I use restlet with Tomcat. First I tried to add JVM command line options for the compiler when tomcat is started. I use a shell script where I added the line below:

-XX:CompileCommand=exclude,com/noelios/restlet/http/HeaderReader,readValue

This did not took effect so I tried a variant of the second option provided by Mark (

http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gbyzo.html

) it consists in create a file named ".hotspot_compiler" and place it at /tomcat_home/bin with this content :

exclude com/noelios/restlet/http/HeaderReader readValue

this took effect because in catalina.out the line below was printed :

CompilerOracle: exclude com/noelios/restlet/http/HeaderReader.readValue


I tested the restlet apps for a few hours and the JVM did not crash anymore. In general the .hotspot_compiler file has to be placed on the application directory so if restlet crashes for you due the Hotspot compiler, you should placed the file where the log for the crash is created.

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

OS:Red Hat Enterprise Linux WS release 4 (Nahant Update 6)

uname:Linux 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:47:23 EST 2008 x86_64
libc:glibc 2.3.4 NPTL 2.3.4
rlimit: STACK 10240k, CORE 0k, NPROC 36864, NOFILE 1024, AS infinity
load average:1.66 1.66 1.65

CPU:total 2 (1 cores per cpu, 1 threads per core) family 15 model 4 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3

Memory: 4k page, physical 4045152k(56520k free), swap 2048276k(2048068k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (10.0-b22) for linux-amd64 JRE (1.6.0_06-b02), built on Mar 25 2008 01:03:02 by "java_re" with gcc 3.2.2 (SuSE Linux)


Thanks to Mark for pointing to us this solution that save me to refactor a lot of code for not be able to use Restlet framework due this JVM bug.


-Marcel


Jerome Louvel wrote:
Thanks for the note, I've added it to the report. Let us know if, on the long term, this effectively works around the HotSpot bug in your environment.

Best regards,
Jerome

------------------------------------------------------------------------
*De :* Mark Derricutt [mailto:[EMAIL PROTECTED]
*Envoyé :* lundi 21 juillet 2008 12:26
*À :* [email protected]
*Objet :* Re: Restlet causing JVM crashes

There's apparantly two ways of doing it:

-XX:CompileCommand=exclude,my/pkg/MyClass,theMethod

or

-XX: CompileCommandFile=/my/canned/command/file

The command file can also be .hotspot_compiler in the current directory. And the ,'s can also be spaced.

I found this via http://forums.sun.com/thread.jspa?messageID=1844071

On Mon, Jul 21, 2008 at 10:20 PM, Jerome Louvel <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Mark,
Thanks for the follow-up. Do you have details on how to configure Hotspot to make it ignore
    this method?
That might be useful for others. I will add it to the related bug
    report as well:
"Segfaults with HotSpot in 64bit Linux"
    http://restlet.tigris.org/issues/show_bug.cgi?id=524
Best regards,
    Jerome
    ------------------------------------------------------------------------
    *De :* Mark Derricutt [mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>]
    *Envoyé :* lundi 21 juillet 2008 12:13

    *À :* [email protected] <mailto:[email protected]>
    *Objet :* Re: Restlet causing JVM crashes

    For now we've told hotspot not to compile that method so hopefully
    that'll help.  I've been following a similar bug report at Sun
    from a problem with Eclipse that has an endless to and fro of "its
    fixed, oh wait... no its not" :(

    Mark

    On Mon, Jul 21, 2008 at 10:10 PM, Jerome Louvel
    <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

        Hi Mark,
I haven't seen this personally yet. BTW, Sun hasn't replied to my bug report submission. I don't
        know if it has been discarded or simply delayed... Maybe you
        should try to submit a report yourself, it might have a better
        fortune...

        Best regards,
        Jerome

        ------------------------------------------------------------------------
        *De :* Mark Derricutt [mailto:[EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>]
        *Envoyé :* lundi 21 juillet 2008 06:13

        *À :* [email protected]
        <mailto:[email protected]>
        *Objet :* Re: Restlet causing JVM crashes

        Hey all,

        This problem's just started to hit again on our production
        boxes running RHEl 3 and RHEL 5 and JDK 1.6_06.

        I tried checking what Kevin changed (volatile to final) but
        can't see any volatile's mentioned in HeaderReader class (but
        my pretty much everywhere else).

        It can't be just us and Kevin seeing this can it?  We're now
        seeing it locally across multiple VM versions.

        Mark

        On Tue, Jun 10, 2008 at 12:12 AM, Kevin Conaway
        <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

            Hi Mark,

            I had the same problem as you.  I tweaked some lines of
            code in that class and recompiled and the issue went away.

            It feels like a bug in the JVM because the error is
            happening when Hotspot decides to recompile the class.  I
never did figure out what was causing it.
            I had posted to [EMAIL PROTECTED] back in April:

            http://restlet.tigris.org/servlets/ReadMsg?list=code&msgNo=139
            <http://restlet.tigris.org/servlets/ReadMsg?list=code&msgNo=139>

            Kevin


            On Wed, Jun 4, 2008 at 12:37 AM, Rob Heittman
            <[EMAIL PROTECTED]
            <mailto:[EMAIL PROTECTED]>> wrote:

                That's a new one on me, but Hardy has been the locus
                of a bunch of new JVM crash issues, mainly with Athlon
                processors.  Also there have been some similar issues
                with 64-bit under Red Hat and Fedora.

                This is the Sun JVM I get installing sun-java6-jdk
                from multiverse, and I don't get JVM crashes on P4,
Centrino, or Core Duo.
                java version "1.6.0_06"
                Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
                Java HotSpot(TM) Client VM (build 10.0-b22, mixed
                mode, sharing)

                Where did you get yours from?  Direct Sun download?
                 Hardy tries very hard to use OpenJDK, which also
                doesn't crash for me on P4, Centrino, or Core Duo.

                - Rob





-- "It is easier to optimize correct code than to correct
        optimized code." -- Bill Harlan




-- "It is easier to optimize correct code than to correct optimized
    code." -- Bill Harlan




--
"It is easier to optimize correct code than to correct optimized code." -- Bill Harlan

Reply via email to