flat assembler
Message board for the users of flat assembler.

Index > Windows > Why does task manager report more memory than allocated?

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 310
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
I wrote this procedures:
Code:
GetMem:
        add     rax,8
        add     [AllocSize],rax
        push    rax
        invoke  VirtualAlloc,0,rax,MEM_COMMIT,PAGE_READWRITE
        pop     rdx
        or      rax,rax
        jz      @F
        mov     [rax],rdx
        add     rax,8
      @@:
        ret

FreeMem:or      rax,rax
        jz      @F
        sub     rax,8
        mov     rdx,[rax]
        sub     [AllocSize],rdx
        invoke  VirtualFree,rax,0,MEM_RELEASE
      @@:
        ret

AllocSize       dq 0
    

and I started certain code which is using them.
Why is AllocSize returning 140 KB and the manager of tasks is returning 17500 KB to the consumed memory? Where from such a divergence?

_________________
smaller is better
Post 05 Jul 2016, 19:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
Task manager reports all the memory used within the process, including all the DLL and system allocations, not just what your code allocates.
Post 06 Jul 2016, 01:33
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.