How to Configure hprof in GlassFish 3.x

These are the steps to configure hprof profiler in GlassFish 3.x:

1, Identify the target JVM to profile.  In most cases, it's the domain administration (DAS) JVM, but it can be other JVM such as another standalone server instance, or a cluster server instance.

2, Edit $GLASSFISH_HOME/config/osgi.properties, locate org.osgi.framework.bootdelegation property, and append hprof classes to it, using , (comma) as the package separator.  Do not forget to add a comma at the end of the existing value.  The resulting property should look like this:

org.osgi.framework.bootdelegation=${eclipselink.bootdelegation}, \
                                  com.sun.btrace, com.sun.btrace.*, \
                                  org.netbeans.lib.profiler, org.netbeans.lib.profiler.*, \

3, Start the domain, and go to admin console to add the hprof profiler:

asadmin start-domain

On the left, choose Configurations | server-config | JVM Settings, on the rigth content panel, choose Profiler tab,

Name: hprof
Status: enabled yes
Classpath: not needed
Native library path: no needed
add a JVM Option:


or using the old non-standard option:


Create this profiler and restart the domain from the command line.  You will see the following elements are added to $GLASSFISH_HOME/domains/domain1/config/domain.xml,

<profiler name="hprof" native-library-path="" classpath="">

So you could also directly edit domain.xml (not recommended) to save you some clicks, if you know where to add this new element.  For server-config, which corresponds to DAS, it is usually after the first group of jvm-options elements.

There is also asadmin CLI commands to create and delete profiler configuration:

asadmin create-profiler hprof

asadmin delete-profiler

But create-profiler command doesn't allow you to specify hprof jvm options, so you would still need to come back to domain.xml to add jvm options.  However, it takes a --target param, where you can specify where to apply the profiler configuration.

4, After starting and stopping the domain, the hprof data file is created in $GLASSFISH_HOME/domains/domain1/config/ directory,  which is the ${user.dir} for GlassFish server process.

Another related post: How to Configure hprof in JBoss AS7


Unknown said...

very good infromation and thanks for sharing this keepitup.
JAVA Online Tutorials

Unknown said...

Hi,I studied how to Configure hprof in GlassFish 3.x in java

Unknown said...

When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I receive 4 emails with the same comment. Is there a means you are able to remove me from that service? Thanks!
Hadoop Online Training

Anna said...

Great and Useful Article.

Online Java Training

Java Online Training India

Java Online Course

Java EE course

Java EE training

Best Recommended books for Spring framework

Java Interview Questions

Java Course in Chennai

Java Online Training India

Unknown said...

very nice information thank you for sharing this information
Microsoft Azure Online Training Institute

Unknown said...

Thank you For tutorials on Testing and the also the other tutorials on Blog are Awosme
SAP Success Factors Training In Hyderabad

Unknown said...

Nice guidance and steps which includes on JAVA, keep it up for more Core and Adv JAVA online training

Unknown said...

You need to visit to - wikiext.com/cfg on this site so many information about file tipes and its configuration

blogs said...


Meritstep Technologies said...

Thanks for sharing this information. I really Like Very Much.
online training institute

anirudh said...

I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting!!Best DevOps Training Institute

yashnit said...

Naresh IT is the best Online software Training Institute for Java, AngularJS, C#.NET, ASP.NET, Oracle, Selenium, Android, C Language, C++, Hadoop, RPA, DevOps, Salesforce, IoT, AWS, Data Science Training Chennai, India which provides online and classroom training classes.

python training in vijayawada said...

This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,

customized gifts for him said...

accent pillow case living room deco
baby canvas nursery
personalised teacher gifts

unknown said...

HVAC & Plumbing Services
Air Star Heating guarantees reliability and quality for all equipment and services.

Air Star Heating specialists always try to deliver the most excellent quality of services to our customers at an affordable price. It is understood that every client has different needs and different problems. We try to accomplish the needs of every client according to their requests. We are having considerable experience in this field. Our specialists understand very well how things work. It doesn’t matter in which field of industry you are looking for services.
Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
Visit:- https://airstarheating.com

data scientist course said...

Thank you for taking the time to publish this information very useful!
data scientist training in hyderabad

Keerthi55 said...

online training in python
online training on python

Kaparthicynixit said...

Thank you for your valuable post. It is really helpful. Keep posting.
Visit us: Core Java Online Course
Visit us: Best Online Java Course