I am analyzing several heap dumps and am interested in a way that I can get the JVM uptime (or start time) from the heap dump. Using eclipse memory analyzer I can easy get the System Properties and class path but can't find a way to find uptime.
Extract JVM uptime from binary heap dump
706 Views Asked by turbanoff At
2
There are 2 best solutions below
0
Forketyfork
On
This may depend on the VM implementation, but at least on OpenJDK HotSpot VM start time and uptime are not being stored on the heap, instead they are implemented as native calls (see sun.management.VMManagementImpl#getStartupTime() and sun.management.VMManagementImpl#getUptime0()). This means that you won't find those values in an existing heap dump.
However, you could use ManagementFactory.getRuntimeMXBean().getUptime() or ManagementFactory.getRuntimeMXBean().getStartupTime() to get these values in a running VM and e.g. put them in system properties (System.getProperties().setProperty()) to be later analyzed as part of the dump.
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in JVM
- How to check what objects are created and where?
- why does Java’s JIT compilation happen within user threads?
- The way Elasticsearch deals with control heap memory when indexing documents
- Within a Clojure project using deps.edn, where is the package name and version tracked?
- spark - How is it even possible to get an OOM?
- files in /tmp/hsperfdata_<user>/ were deleted
- Does an Stackoverflow occur in the JVM if the Activation Record is too small but there is still space left in the general stack?
- android art genertate verification errors,how to
- Understanding Invokedynamic Instruction in Java Bytecode and Its Impact on the Operand Stack
- A compatibility issue between jaydebeapi and jpype
- Java native access violation is not triggering the windows jit debugger
- java flight recorder(jfr) consumes 100% cpu when its supposed to have only 1-2% overhead
- Java reflection returning base type for Scala classes
- What is the exactly time that JNI release the LocalReference automatically?
- jvm exits for unknown reason
Related Questions in HEAP-DUMP
- OOM (Java heap) error due to org.postgresql.core.Field
- How to check the memory leak from the given retained path which contains webviewNode in the Electron app
- Java process mem is less as compared to shown in grafana
- Chronicle Queue Heap memory issue
- How to open heap dump in netbeans 20
- Unexpected call to Finalizer::register
- Java Memory leak: Java.lang.ref.finalizer object
- JBOSS service getting hanged on production server
- Out of memory issues within Matillion
- Profilers not able to take heap/thread dump
- How to Identify what threads are in Queue via Java Heap Dump
- Opening and reading a heapdump file not working on IntelliJ
- Generate Java heap dump programmatically on AIX
- How can I extract raw byte arrays stored in Map<?, byte[]> objects from a Java heap dump?
- Eclipse memory analyzer Heap dump analysis
Related Questions in HPROF
- Intellij Profiler - read/copy/save value
- JVM heap dump without trace information: "Unresolved Name"
- Parsing hprof memory dump
- React Native: .hprof file exceeds GitHub's 100MB file size limit
- Java - Automated CPU / Memory sampling - alternative to HPROF
- How to get Eclipse MAT memory leak suspect report in JSON/XML format?
- Java Could not find agent library hprof on the library path
- What is the difference between android and standard hprof file?
- How to run hprof on mac
- jhat -baseline feature does not work with HeapDumpOnOutOfMemoryError and jcmd GC.heap_dump generated baseline
- Extract JVM uptime from binary heap dump
- Loading objects from .hprof file back into Java program
- react-native: File android/java_pid14920.hprof is 311.59 MB; this exceeds GitHub's file size limit
- Where is the heap dump file created by jcmd?
- Where do references to Java Objects really exist?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can try to search for the
sun.util.calendar.ZoneInfoFileclass, it contains thelong CURRTfield. Its value matches with the JVM start time in VisualVM (in my case, at least, with the Oracle JVM):The epoch converter says it's
2020/1/9 6.47 am EST (GMT-5), the time I launched my Java application. Just in case, thehproffile was created few minutes later, at7.03 am.