Linux 中的选择性核心转储 - 如何选择转储的部分?
我正在寻找一种方法来选择核心转储中包含的部分和内存区域。
我的应用程序的核心转储大小约为 30GB,其中大部分位于预分配的缓冲区中,我什至在调试时不需要这些缓冲区(并且可以稍后清零)。但是,由于转储太大,应用程序需要花费太多时间才能完成崩溃并开始恢复。
任何人都可以想出一种方法来提前选择哪些段将出现在核心转储中吗?
谢谢
I am looking for a way to select the sections and memory regions included in a core dump.
My application's core dump size is about 30GB, most of it is in preallocated buffers which I don't even need in debugging (and can be zeroed later). However, since the dump is so big, it takes too much time for the application to finish crashing and begin recovery.
Can anyone think of a way to select in advance which segments will be in the core dump?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据
core(5)< /code>
手册页,您可以设置将哪些映射写入核心文件:
According to the
core(5)
manpage, you can set which mappings are written to the core file:我不确定是否可以设置要转储内存的哪一部分。
来自
man 5 core
作为一个选项,您可以使用带有
RLIMIT_CORE
参数的setrlimit
来截断核心文件。I'm not sure if it is possible to set which part of the memory to dump.
From
man 5 core
As an option you can truncate core file using
setrlimit
with aRLIMIT_CORE
parameter.