- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This sample code shows a memory leak problem I'm having in Ifort.
---------memoryleak.f90------------
program memoryleak
implicit none
integer :: i,j
real(8),dimension(2000) :: a
open(unit=10,form="unformatted",action="write",status="scratch")
pause
do i=1,1000000
a=dble(i)
j=i/100000+1000
write(10) a(1:j)
end do
pause
close(10)
end program memoryleak
------------------------------
Everything works under ifc 7.1, but if I compile it with ifort (l_fc_pc_8.0.046_pe049.1, upgraded this morning) and I run it, it starts eating up memory until it segfaults.
The problem is in the
write(10) a(1:j)
statement. Apparently ifort has problems with the variable range '1:j' of the array 'a' in the write statement. If I specify a fixed range everything works. Can anyone confirm this behaviour before I submit a bug report?
---------memoryleak.f90------------
program memoryleak
implicit none
integer :: i,j
real(8),dimension(2000) :: a
open(unit=10,form="unformatted",action="write",status="scratch")
pause
do i=1,1000000
a=dble(i)
j=i/100000+1000
write(10) a(1:j)
end do
pause
close(10)
end program memoryleak
------------------------------
Everything works under ifc 7.1, but if I compile it with ifort (l_fc_pc_8.0.046_pe049.1, upgraded this morning) and I run it, it starts eating up memory until it segfaults.
The problem is in the
write(10) a(1:j)
statement. Apparently ifort has problems with the variable range '1:j' of the array 'a' in the write statement. If I specify a fixed range everything works. Can anyone confirm this behaviour before I submit a bug report?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try
ulimit -s unlimited
ulimit -s unlimited
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see evidence of a bug. Rather, ifort 8 uses the stack for array temporaries whereas ifl 7 sometimes used the heap. We recognize that this is not an ideal situation, but it is not a bug. As suggested, raising the stack limit is usually the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed an issue on Intel Premier. The latest update (l_fc_pc_8.0.046_pe050.1) fixed the thing (whether it was a bug or not). Now the code executes correctly without having to touch the stack size.
![](/skins/images/DF2E495CEC88D713A66401CF495CD875/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page