首页 \ 问答 \ 分析Java堆转储时耗尽内存(Running out of memory while analyzing a Java Heap Dump)

分析Java堆转储时耗尽内存(Running out of memory while analyzing a Java Heap Dump)

我有一个奇怪的问题,我需要分析一个1.5GB大小的Java堆转储(来自IBM JRE),问题是在分析转储时(我已经尝试过HeapAnalyzerIBM Memory Analyzer 0.5 )这些工具耗尽内存我无法真正分析转储。 我的机器里有3GB的RAM,但似乎还不足以分析1.5 GB的转储,

我的问题是,您是否知道我可以使用我拥有的内存量运行的堆转储分析(支持IBM JRE转储)的特定工具?

谢谢。


I have a curious problem, I need to analyze a Java heap dump (from an IBM JRE) which has 1.5GB in size, the problem is that while analyzing the dump (I've tried HeapAnalyzer and the IBM Memory Analyzer 0.5) the tools runs out of memory I can't really analyze the dump. I have 3GB of RAM in my machine, but seems like it's not enough to analyze the 1.5 GB dump,

My question is, do you know a specific tool for heap dump analysis (supporting IBM JRE dumps) that I could run with the amount of memory I have?

Thanks.


原文:https://stackoverflow.com/questions/2990609
更新时间:2022-02-13 15:02

最满意答案

你可以使用type_index(c ++ 11)

class Counter
{
public:
  template<class T>
  int plus1() {
    return map_[std::type_index(typeid(T))]++;
  }
private:
  std::map<std::type_index, int> map_;
};

如果在引用多态对象时没有调用,则在编译时推导出typeid


You can use type_index (c++11)

class Counter
{
public:
  template<class T>
  int plus1() {
    return map_[std::type_index(typeid(T))]++;
  }
private:
  std::map<std::type_index, int> map_;
};

typeid is deduced at compile time if not called on reference to polymorphic object.

相关问答

更多
  • 我不知道什么是MyCount ,但我看到了错误。 变量secs类型为String ,但您试图将其与整数(3000,8000)进行比较。 您不能在switch块中使用String变量。 你需要使用那里的整数变量,或者,如果计数器有字符串类型,使用类似这样的代码而不是switch块: if ("8000".equals(secs)) { tv3.setTextColor(Color.RED); } else if ("3000".equals(secs)) { tv3.setTextColor( ...
  • 这个问题的答案将取决于您如何使用该集合的不同方面,以及“完美计数”对您意味着什么。 前言 首先,由于Cloud Function调用与write异步,因此会导致计数器略微落后于集合的真实计数。 我假设这没关系。 即使您通过阅读每个文档来计算集合,计数仍然可能是陈旧的,因为在您计数时可能已插入或删除了文档。 成本 你提到“没有太贵”。 在这里,我们需要了解您阅读计数的频率与添加或删除文档的频率。 要维护一个单独的计数器,您将为每个文档计数更改进行读/写。 由于写入是读取价格的3倍,这意味着您需要将每个文档计数 ...
  • 如果计数器没有属性,则默认为0 ,而不是Counter() >>> from collections import Counter >>> c = Counter({ ... 'a': Counter(), 'b': Counter(), ... }) >>> d = Counter({ ... 'a': Counter() ... }) >>> c['b'] Counter() >>> d['b'] 0 >>> c['b'] + d['b'] Traceback (most recent ...
  • 你必须移动display = document.getElementById("counter2"); 进入每个函数显示的分配是在页面加载时完成的,在两个脚本部分或单个部分中无关紧要。 display = document.getElementById("counter1"); display = document.getElementById("counter2"); // overrides global 显示变量,如: