Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

PowerVC×

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

how can I get javacore/heapdump for the app running on bluemix

110000E8U2 gravatar image
Question by Rajesh K Jeyapaul  (255) | Jul 07, 2014 at 12:19 AM how-toibmcloudjavacoreheapdumpsignals

for application debugging requirement.(sending signals to generate core file). .

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

5 answers

  • Sort: 
110000ABU4 gravatar image

Answer by Andrew Whitfield (4934) | Jul 07, 2014 at 06:19 AM

The Liberty for Java runtime uses the IBM JRE so you can set the IBM_JAVA_OPTIONS environment property that can control the type of diagnostics to create (heapdump, javacore, verbosegc etc) and when to create it (uncaught exception, crash, OOM error etc).

For example, to generate a javacore when a a certain exception is thrown (com.my.exception.class in this case) set the following user-defined environment variable (via ACE or CF):

Name: IBM_JAVA_OPTIONS
Value: -Xdump:java:events=throw,filter=com/my/exception/class -Xdump:tool:events=throw,filter=com/my/exception/class,opts=ASYNC,exec="/app/.liberty/bin/server dump defaultServer" -Xdump:what

The javacore should then be generated in this location: /app/.liberty/usr/servers/defaultServer/

The above will also work for IBM Java buildpacks as the -Xdump options are part of the standard IBM JRE.

Comment
KrisKobylinski
JohnPape
Tom_Leend

People who like this

  3   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
060000YCS5 gravatar image

Answer by Rohit Kelapure (1001) | Jul 07, 2014 at 08:19 AM

The easiest way to do this is to use the Runtime Management Utility

To do this, select a Liberty application in the user interface. Under Runtime in the navigation on the left, you can open the instance details. Select an instance or multiple instances. Under the Actions menu, you can choose TRACE or DUMP.

Taking a dump

Comment
MichaelPeters
JohnPape

People who like this

  2   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
120000EDQP gravatar image

Answer by Peter Broadhurst (359) | Sep 25, 2014 at 05:08 PM

You could push a servlet with the following code:

protected void doGet(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
PrintWriter out = response.getWriter();
response.setContentType("text/plain");
try {
Class<?> dumper = Class.forName("com.ibm.jvm.Dump");
Method javadump = dumper.getDeclaredMethod("JavaDump", new Class<?>[]{});
javadump.invoke((Object[])null, (Object[])null);
out.println("Javacore dumped. See cf logs for location");
}
catch (Exception e) {
e.printStackTrace(out);
}
}
Comment
takehiko.amano
JohnPape

People who like this

  2   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270000XYBA gravatar image

Answer by Ram Vennam (2928) | Jul 07, 2014 at 08:43 AM

This is not what you asked, but you might find it relevant: https://developer.ibm.com/bluemix/2014/06/18/collecting-diagnostics-crash-2/

Comment
Richard Bone

People who like this

  1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
120000C34W gravatar image

Answer by takehiko.amano (4219) | Jul 07, 2014 at 02:51 AM

If you are running IBM Java, send the "kill -3". I believe this will not terminate JVM. But will produce javacore.XXX.txt.

Then your javacore.XXX.txt can be downloaded via.

cf files <app-name> <path-to-corefile>/javacore.XXX.txt > javacore.txt

Not sure about heapdump. Note if your application is get terminated, then your files system on the VM will be gone too. Heal Manager will invoke another VM instance which is probably in healthy status (no core, no heapdump).

Another person may have suggestion to create heapdump while the application is running.

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270006JGHJ gravatar image Richard Johnson (3602) ♦   Jul 15, 2014 at 11:30 AM 1
Share

I don't think there is a way to send a 'kill -3' to the app directly. Some of the other answers posted will have to be used.

Follow this question

No one has followed this question yet.

Answers

Answers & comments

Related questions

How to write to a file on nodejs server 1 Answer

Data Studio 4.1.0.1 - Throwing an error while uploading the records 1 Answer

I created Mobile Cloud boilerplate in bluemix and i need to get my application secret key. how do i find this 1 Answer

Can I add users in Watson Knowldge Studio for free (in the standard edition) ? 1 Answer

Pushing a Liberty Server 6 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges