简体   繁体   English

如何分析ArangoDB Foxx应用程序中的内存使用情况

[英]How to profile memory usage in an ArangoDB Foxx App

Stress testing my Foxx App eventually crashes ArangoDB with a SIGSEGV. 对我的Foxx App进行压力测试最终导致SIGSEGV使ArangoDB崩溃。 Looking at the core file it seems to be related to V8 running out of memory. 查看核心文件,这似乎与V8内存不足有关。 I'd like to do memory profiling on the heap to help track down potential leaks. 我想对堆进行内存分析,以帮助跟踪潜在的泄漏。 Since the V8 engine is an integral part of arangod, how do I access and use the V8 profiler? 由于V8引擎是Arangod不可或缺的一部分,我如何访问和使用V8分析器? The node modules that help with this all have C++ modules so they won't run right under Foxx. 与此相关的节点模块都具有C ++模块,因此它们将无法在Foxx下运行。

Unfortunately, the V8 engine and its garbage collection has some glitches regarding the memory management. 不幸的是,V8引擎及其垃圾回收在内存管理方面存在一些故障。

In some cases, it runs in tight loops to squeeze a bit more memory out of the system, sometimes it instantly terminates the process instead of giving its host process a chance to cope with the situation. 在某些情况下,它会紧密循环运行以从系统中挤出更多的内存,有时它会立即终止该进程,而不是为其宿主进程提供应对这种情况的机会。

This is a problem with which all V8 based solution have to fight - Node.JS too. 所有基于V8的解决方案都必须解决这个问题-Node.JS。 The V8 team is working on this, and with every version they make progress. V8团队正在为此工作,并且在每个版本上都取得了进展。 But the end of the road isn't reached yet by now. 但是到目前为止,这条路还没有到。

Regarding debugging interface which would most probably also provide the memory profiling, we are well aware of that its currently missing and tracking progress on this via the github issue #1538 . 关于最有可能还会提供内存配置文件的调试接口,我们很清楚它的当前缺失, 并通过github问题#1538跟踪其进度 As resources become available for this topic, we will start working on it. 随着资源可用于该主题,我们将开始着手研究。

You probably can use flamgegraphs in some way right now with the aid of the linux kernel, but it seems to be problematic to write the names of the JIT compiled functions required to make this more usefull. 您现在可以借助linux内核以某种方式使用flamgegraphs ,但是编写使此功能更有用的JIT编译函数的名称似乎有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM