如何在Fortran 2003程序中找到内存泄漏的原因? [英] How can I find the cause for a memory leak in Fortran 2003 program?

查看:648
本文介绍了如何在Fortran 2003程序中找到内存泄漏的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Fotran 2003编写的Fortran程序,并使用英特尔(R)Fortran编译器XE编译使用IA-32版本12.1.2.273上运行的应用程序生成20111128



长时间运行我的程序(这是一个物理计算)后,我读出:

内存不足以分配Fortran RTL消息缓冲区,消息

我猜想它与我的程序中的内存泄漏有关
如何找出泄漏发生的位置以及如何修复它作为第一个答案表明,你的问题是非常笼统的,而不是特定的答案可以修改的。 你在使用指针吗?指针不如可分配的安全 - 如果它们能够完成这项工作,则切换到可分配的对象。


$ b $

调试ifort选项的建议: -O2 -stand f03 -assume realloc_lhs -check all -traceback -warn all -fstack-protector-假设protect_parens -implicitnone


I have a Fortran program I wrote using Fotran 2003 and compiled using

Intel(R) Fortran Compiler XE for applications running on IA-32, Version 12.1.2.273 Build 20111128

after running my program for a long run ( it's a physical computation ) I have the out read:
Insufficient memory to allocate Fortran RTL message buffer, message

I guessed it has to do with memory leak in my program How can I find out where is the leak occurring and how to fix it?

解决方案

As the first answer indicates, your question is very general and not so amendable to a specific answer. Are you using pointers? Pointers are less safe than allocatables --- switch to allocatables if they will do the job.

A suggestion for debugging options for ifort: -O2 -stand f03 -assume realloc_lhs -check all -traceback -warn all -fstack-protector -assume protect_parens -implicitnone

这篇关于如何在Fortran 2003程序中找到内存泄漏的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆