Websphere 中 javacore、线程转储和堆转储之间的区别

发布于 2024-08-02 11:44:34 字数 52 浏览 15 评论 0原文

有人能告诉我 javacore、线程转储和堆转储之间的确切区别吗?这些都在什么情况下使用?

Can someone tell me the exact difference between javacore, thread dump and heap dump? Under which situation each of these are used??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

情定在深秋 2024-08-09 11:44:34

线程转储是所有活动线程的堆栈转储。因此,对于分析应用程序在某个时间点的状态非常有用,并且如果定期执行,则可以方便地诊断某些类型的“执行”问题(例如线程死锁)。

堆转储是 Java 堆内存状态的转储。因此,对于分析应用程序在某个时间点的内存使用情况很有用,可以方便地诊断一些内存问题,并且如果定期进行,可以方便地诊断内存泄漏。

这就是它们的“原始”术语,并且可以通过多种方式提供。通常用于描述来自 JVM 和应用程序服务器的转储文件,在这种形式下,它们是一种低级工具。如果由于某种原因你无法获得其他任何东西,那么很有用,但是你会发现使用像样的分析工具来获取类似但更容易剖析的信息会更轻松。

对于WebSphere,javacore 文件是一个线程转储,尽管包含许多其他信息,例如锁和加载的类以及一些有限的内存使用信息,而PHD 文件是一个堆转储。

如果您想读取 javacore 文件,您可以手动执行此操作,但有一个 IBM 工具(BM Thread and Monitor Dump Analyzer)可以使其变得更简单。如果您想要读取堆转储文件,您需要使用众多 IBM 工具之一:MDD4J 或 Heap Analyzer。

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.

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.

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.

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.

黯淡〆 2024-08-09 11:44:34

JVM 头转储是给定时间内 JVM 堆内存的快照。所以它只是 JVM 的堆表示。这就是物体的状态。

JVM 线程转储是给定时间 JVM 线程的快照。这就是线程在任何给定时间所做的事情。这就是线程的状态。这有助于理解锁定线程、挂起线程和运行线程等。

头转储比线程转储具有更多的 Java 类级别信息。例如,Head dump 非常适合分析 JVM 堆内存问题和 OutOfMemoryError 错误。当发生 OutOfMemoryError 之类的情况时,会自动生成 JVM 头转储。可以通过使用kill -3 终止进程来手动创建堆转储。生成堆转储是一项密集型计算任务,这可能会挂起您的 jvm。所以这不是一个经常使用的方法。可以使用eclipse内存分析器等工具来分析堆。

核心转储是对象的操作系统级别内存使用情况。它比头脑转储有更多的信息。当我们故意终止进程时,不会创建核心转储。

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 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.

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.

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.

站稳脚跟 2024-08-09 11:44:34

任何时候您希望查看内存中保存的内容时都会进行堆转储 内存不足错误
堆转储 - 内存对象的图片 - 用于内存分析
Java 核心 - 也称为线程转储或 java 转储,用于查看给定时间 JVM 内的线程活动。 IBM javacores 应该很多
除了线程和堆栈之外的附加信息——用于确定挂起、死锁和性能下降的原因
系统核心

Heap dumps anytime 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 dumps or 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

冧九 2024-08-09 11:44:34

线程转储是所有线程堆栈跟踪的转储,即就好像每个线程突然抛出异常并 printStackTrace'ed。这样您就可以看到每个线程在某个特定点正在做什么,并且非常适合捕获死锁。

堆转储是 JVM 正在使用的全部内存的“二进制转储”,如果您需要知道为什么内存不足,则该堆转储非常有用 - 例如,在堆转储中您可以看到您有 10 亿个内存用户反对,即使你应该只有一千个,这表明存在内存保留问题。

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.

烟柳画桥 2024-08-09 11:44:34

线程转储是 javacore 显示 JVM 中运行的线程的快照,对于调试挂起问题很有用,它将提供有关 java 级死锁的信息,并且 IBM 版本的 javacore 提供了更多有用的信息,例如堆使用情况、每个线程的 CPU 使用情况线程和总体堆使用情况以及 JVM 加载的类的数量。

Heapdumps 提供有关 JVM 使用 Java 堆的信息,可用于调试内存泄漏。当 JVM 遇到内存不足错误时,IBM JVM 会生成堆转储,堆转储仅适用于 Java 中的堆泄漏,本机内存不足错误可能会导致系统转储,通常会出现“GPF”一般保护错误。

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文