FastMM,用于动态加载 DLL 中泄漏的堆栈跟踪内存,使用运行时包编译
我将 FastMM 与 JCL 调试信息一起使用来跟踪应用程序中的内存泄漏。不过我有一些插件,它们是在 Delphi 中编译的 dll,dll 和主应用程序都使用通用的运行时包。现在,当我关闭应用程序时,它会在文本文件中生成内存泄漏报告,这很好,但它包含仅适用于主应用程序的堆栈跟踪。如果插件dll中发生内存泄漏,堆栈跟踪会指向LoadPlugins;主应用程序中的程序! 当然,我的插件包含 JCL 调试数据(它被插入到 .dll 二进制文件中)。
问题出在哪里?这是因为运行时包的使用吗? 或者我忘记启用/禁用某些开关(定义)? 提前致谢
I'm using FastMM together with JCL Debug info to trace memory leaks in my application. However I have plugins which are dlls compiled in Delphi, both dlls and main application use common runtime packages. Now, when I'm shutting down the application, it generates memory leaks report in text file which is fine, but it contains stack traces only for main application. If memory leak occurs in plugin dll, the stack trace leads to LoadPlugins; procedure in main application!
Of course my plugins contain JCL debug data (it's inserted into .dll binary).
Where is the problem? Is that because of runtime packages usage?
Or some switch (define) which I forgot to enable/disable?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否在 FastMM4Options.inc 中设置了 FullDebugMode 选项和内存管理器共享选项(ShareMM 及以下选项)?
您是否还使用调试信息进行了编译?
Have you set the FullDebugMode options and the Memory Manager Sharing Options (ShareMM and following) in FastMM4Options.inc?
Have you also compiled with debug infos?
FastMM的作者Pierre回答了我的问题。如果有人感兴趣,解决方案是不要在关闭时卸载插件以保留堆栈跟踪和信息。可访问的对象类型。然而,这在关闭时导致了大量错误(因为 FastMM 被卸载了两次左右),所以最后我不得不将 FastMM 移动到共享包......
Pierre, author of FastMM has answered my question. If anyone is interested, the solution is not to unload plugins at shutdown in order to keep stack traces & object types accessible. This however caused tons of bugs on shutdown (since FastMM was unloaded twice or so), so finally I had to move FastMM to shared package...