dev@glassfish.java.net

Re: Slow Startup time for Glassfish and asadmin on Mac

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Mon, 14 Jun 2010 19:10:14 -0500

I set AS_DEBUG to true and didn't see anything meaningful:

CLASSPATH=
/Users/jasonlee/src/servers/glassfishv3/bin/../glassfish/modules/admin-cli.jar
Commands: [start-domain, domain1]
asadmin extension directory:
/Users/jasonlee/src/servers/glassfishv3/glassfish/lib/asadmin
Prepare
Not using local password
Process program options
Parsing program options
Parse command options
params: {}
operands: [domain1]
Prevalidate command options
Inject command options
Validate command options
asadmin --host localhost --port 4848 --interactive=true --echo=false
--terse=false start-domain --verbose=false --upgrade=false --debug=false
domain1
Execute command
/0.0.0.0 : 6666 --> FREE
halpert/192.168.1.100 : 6666 --> FREE
localhost/127.0.0.1 : 6666 --> FREE
Time spent in master password extraction: 108 msec
/0.0.0.0 : 4848 --> FREE
halpert/192.168.1.100 : 4848 --> FREE
localhost/127.0.0.1 : 4848 --> FREE
Waiting for the server to start Check for pid file:
/Users/jasonlee/src/servers/glassfishv3/glassfish/domains/domain1/config/pid
.Check for pid file:
/Users/jasonlee/src/servers/glassfishv3/glassfish/domains/domain1/config/pid


It still took a LONG time before anything started. I've attached the
thread dump (jstack <pid>), but I'm not even close to being an expert at
reading these things. The thread dump was taken when the log was stuck at

Jun 14, 2010 3:56:53 PM
com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 117 msec.

Any clues?

On 6/9/10 3:21 PM, Byron Nevins wrote:
> set this in your env
>
> AS_DEBUG=true
>
> On 6/9/2010 12:48 PM, Jason Lee wrote:
>> I am currently plagued and bedeviled by REALLY slow startup times on
>> my Mac. Glassfish and asadmin take a REALLY long time to start
>> working. Once they do, they run fine, but the getting there is
>> difficult, which is really problematic, as I have to restart the
>> server a lot. For example, take this asadmin invocation:
>>
>> $ time ./asadmin list-commands
>> ...
>>
>> Command list-commands executed successfully.
>>
>> real 0m30.773s
>> user 0m0.928s
>> sys 0m0.123s
>>
>> As opposed to on my MUCH slower ~6 year old Linux box:
>>
>> $ time ./asadmin list-commands
>> ...
>> Command list-commands executed successfully.
>>
>> real 0m6.526s
>> user 0m1.021s
>> sys 0m0.169s
>>
>> The only env var I can see that might affect the speed is JAVA_OPTS,
>> which is set to "-Xmx512m", but clearing that doesn't help. Maven
>> and other Java-based tools don't seem to be bothered by this. My
>> environment is Snow Leopard with java full version
>> "1.6.0_20-b02-279". Plenty of disk and memory available.
>>
>> Any ideas? This is killing me. :)
>>
>


-- 
Jason Lee
Senior Member of Technical Staff
GlassFish Administration Console
Oracle Corporation
Phone +1 405-216-3193
Blog http://blogs.steeplesoft.com