- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I found a strange thing when I debugging the following code:
implicit none
integer::i,j,n
real*8,allocatable::a(:)
n=100000000
allocate(a(n))
1 &
do j=1,n
a(j)=0.d0
enddo
2 &
end
I set two breakpoints at the label 1 and 2 respectively. When the program runs to the label 1, the memory usage is (observed from Windows Task Manager):
Mem Usage: 2,488k VM Size: 783,516k
However, after it runs to the label 2, the memory usage changes greatly:
Mem Usage: 785,264k VM Size: 783,516k
Could anyone explain the changes of memory usage?
Thanks,
Zhanghong Tang
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, that's a new concept for me. Then how to 'measure' the memory usage of a program? Based on the allocated space or the space which is actually touched? Is there any program to 'measure' the memory usage of a subroutine?
Thanks,
Zhanghong Tang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows will tell you the total virtual address space assigned to your process, the maximum available and how many physical memory pages you are using. Depending on why you care, you may want any or all of these.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page