Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Memory leakage regression?

mhermanns
Beginner
439 Views
Hi,

I think I have found the following regression from the previous build of the 9.0 compiler. The problem has to do with allocatable components in derived types. Two versions ago no automatic deallocation was done for intent(out) dummy arguments, something that was then solved in the previous version (see discussion in http://softwareforums.intel.com/ids/board/message?board.id=11&message.id=2986).

My code was then working perfectly till I updated to the last version. Now it turns out that allocatable components in local derived types are not automatically deallocated at the exit of procedures. The following example shows the problem:

!-----------------------------------------------------!
module Module_Example
implicit none

type Sparse_Matrix
real, allocatable :: Values(:)
integer, allocatable :: Columns(:), Rows(:)
end type Sparse_Matrix

contains
!-----------------------------!
subroutine Do_Nothing

type(Sparse_Matrix) :: A

allocate(A%Values(1000),A%Columns(1000),A%Rows(1000))

end subroutine Do_Nothing
!-----------------------------!
end module Module_Example
!-----------------------------------------------------!
program Example
use Module_Example
implicit none

integer :: i

do i = 1, 100000
call Do_Nothing
enddo

end program Example
!-----------------------------------------------------!

The result is a severe memory leakage. Hope the above example is helpful.

Greetings from Spain,

Miguel
0 Kudos
2 Replies
Steven_L_Intel1
Employee
439 Views
I can reproduce this and can verify that it used to work. Please report this to Intel Premier Support and reference T62149.
0 Kudos
mhermanns
Beginner
439 Views
Done. The issue number is 345291.

Miguel
0 Kudos
Reply