Websphere中javacore、线程转储和堆转储的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1300497/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between javacore, thread dump and heap dump in Websphere
提问by
Can someone tell me the exact difference between javacore, thread dump and heap dump? Under which situation each of these are used??
有人能告诉我 javacore、线程转储和堆转储之间的确切区别吗?在什么情况下使用这些中的每一个?
回答by
Heap dumpsanytime you wish to see what is being held in memory Out-of-memory errors Heap dumps - picture of in memory objects - used for memory analysis Java cores - also known as thread dumpsor java dumps, used for viewing the thread activity inside the JVM at a given time. IBM javacores should a lot of additional information besides just the threads and stacks -- used to determine hangs, deadlocks, and reasons for performance degredation System cores
堆转储可以随时查看内存中保存的内容 内存不足错误 堆转储 - 内存中对象的图片 - 用于内存分析 Java 内核 - 也称为线程转储或 Java 转储,用于查看线程活动在给定时间在 JVM 内部。除了线程和堆栈之外,IBM javacores 还应该有很多附加信息——用于确定挂起、死锁和性能下降的原因 系统内核
回答by stolsvik
A Thread dump is a dump of all threads's stack traces, i.e. as if each Thread suddenly threw an Exception and printStackTrace'ed that. This is so that you can see what each thread is doing at some specific point, and is for example very good to catch deadlocks.
线程转储是所有线程堆栈跟踪的转储,即好像每个线程突然抛出异常并打印堆栈跟踪。这样您就可以看到每个线程在某个特定点正在做什么,例如非常适合捕获死锁。
A heap dump is a "binary dump" of the full memory the JVM is using, and is for example useful if you need to know why you are running out of memory - in the heap dump you could for example see that you have one billion User objects, even though you should only have a thousand, which points to a memory retention problem.
堆转储是 JVM 正在使用的完整内存的“二进制转储”,例如,如果您需要知道内存不足的原因,它很有用 - 例如,在堆转储中您可以看到您有十亿用户对象,即使您应该只有一千个,这表明存在内存保留问题。
回答by Jason
A thread dump is a dump of the stacks of all live threads. Thus useful for analysing what an app is up to at some point in time, and if done at intervals handy in diagnosing some kinds of 'execution' problems (e.g. thread deadlock).
线程转储是所有活动线程堆栈的转储。因此对于分析应用程序在某个时间点的状态非常有用,并且如果每隔一段时间完成,则有助于诊断某些类型的“执行”问题(例如线程死锁)。
A heap dump is a dump of the state of the Java heap memory. Thus useful for analysing what use of memory an app is making at some point in time so handy in diagnosing some memory issues, and if done at intervals handy in diagnosing memory leaks.
堆转储是 Java 堆内存状态的转储。因此,对于分析应用程序在某个时间点使用的内存非常有用,因此在诊断某些内存问题时非常方便,如果每隔一段时间进行一次,则有助于诊断内存泄漏。
This is what they are in 'raw' terms, and could be provided in many ways. In general used to describe dumped files from JVMs and app servers, and in this form they are a low level tool. Useful if for some reason you can't get anything else, but you will find life easier using decent profiling tool to get similar but easier to dissect info.
这就是它们的“原始”术语,可以通过多种方式提供。通常用于描述来自 JVM 和应用程序服务器的转储文件,在这种形式下,它们是一种低级工具。如果由于某种原因您无法获得其他任何东西,则很有用,但是您会发现使用体面的分析工具来获得类似但更易于剖析的信息,生活更轻松。
With respect to WebSphere a javacore file is a thread dump, albeit with a lot of other info such as locks and loaded classes and some limited memory usage info, and a PHD file is a heap dump.
对于 WebSphere,javacore 文件是一个线程转储,尽管包含许多其他信息,例如锁和加载的类以及一些有限的内存使用信息,而 PHD 文件是一个堆转储。
If you want to read a javacore file you can do so by hand, but there is an IBM tool (BM Thread and Monitor Dump Analyzer) which makes it simpler. If you want to read a heap dump file you need one of many IBM tools: MDD4J or Heap Analyzer.
如果您想读取 javacore 文件,您可以手动进行,但是有一个 IBM 工具(BM Thread and Monitor Dump Analyzer)可以使它更简单。如果您想读取堆转储文件,您需要许多 IBM 工具之一:MDD4J 或 Heap Analyzer。
回答by Krishna Jaladhi
Thread dumps are javacore show snapshot of threads running in JVM, it is useful to debug hang issues, it will provide info about java level dead locks and also IBm version of javacores provides much more useful information, such as heap usage, CPU usage of each thread and overall heap usage along with number of classes laded by the JVM.
线程转储是 javacore 显示在 JVM 中运行的线程的快照,它对调试挂起问题很有用,它将提供有关 java 级别死锁的信息,而且 javacores 的 IBm 版本提供了更多有用的信息,例如堆使用情况、每个线程的 CPU 使用情况线程和总体堆使用情况以及 JVM 加载的类数。
Heapdumps, provides information about Java heap usage by an JVM, which can be used to debug memory leaks. Heapdumps are generated by IBM JVMs when a JVM is runs into outofmemoryerror, Heapdumps are only for heap leaks in java, native out of memory error may result system dumps usually with an "GPF" General protection Fault.
Heapdumps,提供有关 JVM 使用 Java 堆的信息,可用于调试内存泄漏。堆转储由 IBM JVM 在 JVM 遇到内存不足错误时生成,堆转储仅用于 Java 中的堆泄漏,本机内存不足错误可能导致系统转储通常带有“GPF”一般保护错误。
回答by Nu-ONE
JVM head dump is a snapshot of a JVM heap memory in a given time. So its simply a heap representation of JVM. That is the state of the objects.
JVM head dump 是给定时间内JVM 堆内存的快照。所以它只是JVM的堆表示。这就是对象的状态。
JVM thread dump is a snapshot of a JVM threads at a given time. So thats what were threads doing at any given time. This is the state of threads. This helps understanding such as locked threads, hanged threads and running threads.
JVM 线程转储是给定时间 JVM 线程的快照。这就是线程在任何给定时间所做的事情。这是线程的状态。这有助于理解诸如锁定线程、挂起线程和运行线程。
Head dump has more information of java class level information than a thread dump. For example Head dump is good to analyse JVM heap memory issues and OutOfMemoryError errors. JVM head dump is generated automatically when there is something like OutOfMemoryError has taken place. Heap dump can be created manually by killing the process using kill -3 . Generating a heap dump is a intensive computing task, which will probably hang your jvm. so itsn't a methond to use offetenly. Heap can be analysed using tools such as eclipse memory analyser.
头转储比线程转储具有更多的 Java 类级别信息。例如 Head dump 可以很好地分析 JVM 堆内存问题和 OutOfMemoryError 错误。当发生 OutOfMemoryError 之类的事情时,会自动生成 JVM 头转储。可以通过使用 kill -3 终止进程来手动创建堆转储。生成堆转储是一项密集的计算任务,它可能会挂起您的 jvm。所以它不是一种经常使用的方法。可以使用 eclipse 内存分析器等工具分析堆。
Core dump is a os level memory usage of objects. It has more informaiton than a head dump. core dump is not created when we kill a process purposely.
核心转储是对象的操作系统级内存使用情况。它比头部转储有更多的信息。当我们故意杀死进程时,不会创建核心转储。