So I'm looking for ways to solve this.
So far I've managed to cut about 1/4 of the time off a typical startup
by passing -XX:CompileThreshold=1500 and -XX:-Inline, hoping to make
the server compiler mimic more closely what the client compiler does.
This definitely does help, trimming off as much as 25-30%. It's still
not as fast as client though, and this doesn't seem to work on all
platforms (worked on an EC2 Linux instance, didn't work on my home
Linux box.
I've tried TieredCompilation as well, with b117 of the JDK7 EA, and it
did not appear to start up much faster than straight-up server mode.
I'm curious if anyone else has ideas for flags to speed up server mode.
- Charlie
Le 08/11/2010 16:46, Charles Oliver Nutter a �crit :
> More and more folks are running on 64-bit systems these days, and as a
> result more people are having to cope with Hotspot's 64-bit JVM only
> having a "server" mode. Given server mode's dreadful startup
> characteristics, this has started to turn people off using JRuby (and
> probably other projects) at the command line, since it can take as
> much as an order of magnitude longer to boot e.g. rails applications
> in server mode.
Do you try profile the rails apps + your runtime ?
> So I'm looking for ways to solve this.
>
> So far I've managed to cut about 1/4 of the time off a typical startup
> by passing -XX:CompileThreshold=1500 and -XX:-Inline, hoping to make
> the server compiler mimic more closely what the client compiler does.
> This definitely does help, trimming off as much as 25-30%. It's still
> not as fast as client though, and this doesn't seem to work on all
> platforms (worked on an EC2 Linux instance, didn't work on my home
> Linux box.
>
> I've tried TieredCompilation as well, with b117 of the JDK7 EA, and it
> did not appear to start up much faster than straight-up server mode.
Tiered compilation doesn't use the CompileThreshold flag but its own set
of flags:
see
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2010-November/004239.html
> I'm curious if anyone else has ideas for flags to speed up server mode.
>
> - Charlie
R�mi
Slightly off-topic, but least on Debian you can easily install a
32-bit JVM on 64-bit systems:
http://packages.debian.org/lenny/ia32-sun-java6-bin
Install and run update-java-alternatives. I haven't tried myself (I
wish I had know this when I needed it) but a friend reported reduced
memory usage after making the switch.
Hannes
> So far I've managed to cut about 1/4 of the time off a typical startup
> by passing -XX:CompileThreshold=1500 and -XX:-Inline, hoping to make
> the server compiler mimic more closely what the client compiler does.
> This definitely does help, trimming off as much as 25-30%. It's still
> not as fast as client though, and this doesn't seem to work on all
> platforms (worked on an EC2 Linux instance, didn't work on my home
> Linux box.
>
> I've tried TieredCompilation as well, with b117 of the JDK7 EA, and it
> did not appear to start up much faster than straight-up server mode.
>
> I'm curious if anyone else has ideas for flags to speed up server mode.
>
> - Charlie
>
> --
> You received this message because you are subscribed to the Google Groups "JVM Languages" group.
> To post to this group, send email to jvm-la...@googlegroups.com.
> To unsubscribe from this group, send email to jvm-language...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.
>
>
Yes, but unfortunately profiling either introduces so much overhead it
masks the actual startup time...and profiling isn't particularly good
at startup anyway.
As far as JRuby's concerned, much of the time taken during startup of
a large app is simply parsing and executing all those Ruby scripts.
Our parser is definitely not a simple piece of code, and there's a lot
happening as an application boots. We've knocked down a few obvious
bottlenecks, but our startup time is at *best* an order of magnitude
slower than C Ruby for any given app. On server, it's more like two
orders of magnitude.
Most of my experiments have pointed toward the lack of quick jitting
and the cost of jitting once it happens as the primary costs running
on the server VM. That's largely why reducing compilation threshold
and disabling inlining improves that startup time.
> Tiered compilation doesn't use the CompileThreshold flag but its own set of
> flags:
> see
> http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2010-November/004239.html
Yes, I saw that thread. I haven't tried tuning the other thresholds
yet, but that may be the next attempt. However, since I need options
for real users on Java 6, I'd still like to hear if there's other
server-tuning flags that can make compiles come more quickly and with
less overhead. I will keep poking at it.
- Charlie
Yes, my #1 recommendation for JRuby users right now is to use 32-bit
client JVM in development. The startup time difference is night and
day.
- Charlie
Sure, the relief is there since September.
Just ask him to run with -XX:+TieredCompilation.
And also with -XX:CompilationPolicyChoice=3 if he uses official Oracle binaries (the ones that are built from CI).
igor
On 11/16/10 1:34 PM, John Rose wrote:JRuby's Charlie Nutter is having big problems with startup time withserver compiler on x86_64.http://groups.google.com/group/jvm-languages/browse_thread/thread/3052f5cdb929e9ee#