- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this and can verify that it used to work. Please report this to Intel Premier Support and reference T62149.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Done. The issue number is 345291.
Miguel
Miguel

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