Don't worry, it's because the "standard" memory figure includes shared DLLs and such. What you want to do is to get Process Explorer, then add the "private bytes" figure to the column, that shows the "real" memory use of your app.

22 Jul 2006, 08:40

Adam Mrówka

Joined: 04 Jul 2006
Posts: 4
Location: poznan, poland

Adam Mrówka

jeah, at least it use only 616 kb but how decrease amount of memory?

should i use Heap instruction to reduce memory usage?

22 Jul 2006, 15:40

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

616kb of private data? Not really a problem IMHO. Most of this is one-time overhead.

You can SetProcessWorkingSetSize(GetCurrentProcess(), -1,-1) - but that's sorta silly.

616kb of private data? Not really a problem IMHO. Most of this is one-time overhead.

Okay, I have to admit, the .exe loader and stuff like that in Windows is really blurred to me. What's that private data anyway, and why is it so "big" for a private data?

_________________Previously known as The_Grey_Beast

22 Jul 2006, 16:33

calpol2004

Joined: 16 Dec 2004
Posts: 110

calpol2004

the task manager is very unaccurate like one of the other users said (it includes all the dll's and resources n stuff the program is using or something like that ), use something like process explorer to find out the real usage.

24 Jul 2006, 13:50

kohlrak

Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad

kohlrak

calpol2004 wrote:

the task manager is very unaccurate like one of the other users said (it includes all the dll's and resources n stuff the program is using or something like that ), use something like process explorer to find out the real usage.

Actually... What it calls from DLLs is basically what i uses in the RAM and such. So if you're worried how much space it takes, you should rely on it. If you go by how much bytes it uses (excluding DLLs and all the things it includes) you're gonna expect it to run in really really poor conditions. Not like it really matters in a small project like the hello programs, but let's say you're coding something as power dependant as halo1 pc. imagin if they only recorded what the exe itself and it's DLLs took of the RAM not including what the OS requires with it... I could see it now... "Only 64 MB of ram needed." Then when the OS takes the other 64 that dosn't exist and the computer crashes, you got a major complaint. So i really don't see the point in getting what the EXE alone uses. One would think, anyway, that the EXE would only use the amount of space that the exe is if you don't include the space of the DLLs. At least that's what i think...

24 Jul 2006, 19:37

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

kohlrak wrote:

calpol2004 wrote:

the task manager is very unaccurate like one of the other users said (it includes all the dll's and resources n stuff the program is using or something like that ), use something like process explorer to find out the real usage.

Actually... What it calls from DLLs is basically what i uses in the RAM and such. So if you're worried how much space it takes, you should rely on it. If you go by how much bytes it uses (excluding DLLs and all the things it includes) you're gonna expect it to run in really really poor conditions. Not like it really matters in a small project like the hello programs, but let's say you're coding something as power dependant as halo1 pc. imagin if they only recorded what the exe itself and it's DLLs took of the RAM not including what the OS requires with it... I could see it now... "Only 64 MB of ram needed." Then when the OS takes the other 64 that dosn't exist and the computer crashes, you got a major complaint. So i really don't see the point in getting what the EXE alone uses. One would think, anyway, that the EXE would only use the amount of space that the exe is if you don't include the space of the DLLs. At least that's what i think...

Wrong again

The reason you don't "count in DLLs" is that their code and data is shared between processes. What you need to do is get hold of Process Explorer (or use perfmon.msc which is included with 2k and XP), and look at the memory statistics counter called "Private Bytes".

This figure is the amount of, well, private bytes in your process. Memory not shared with other processes, memory that in low-memory situations will have to be paged out to disk and re-read, rather than discarded and re-read from .exe/.dll.

_________________ - carpe noctem

25 Jul 2006, 11:12

kohlrak

Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad

kohlrak

f0dder wrote:

kohlrak wrote:

calpol2004 wrote:

the task manager is very unaccurate like one of the other users said (it includes all the dll's and resources n stuff the program is using or something like that ), use something like process explorer to find out the real usage.

Actually... What it calls from DLLs is basically what i uses in the RAM and such. So if you're worried how much space it takes, you should rely on it. If you go by how much bytes it uses (excluding DLLs and all the things it includes) you're gonna expect it to run in really really poor conditions. Not like it really matters in a small project like the hello programs, but let's say you're coding something as power dependant as halo1 pc. imagin if they only recorded what the exe itself and it's DLLs took of the RAM not including what the OS requires with it... I could see it now... "Only 64 MB of ram needed." Then when the OS takes the other 64 that dosn't exist and the computer crashes, you got a major complaint. So i really don't see the point in getting what the EXE alone uses. One would think, anyway, that the EXE would only use the amount of space that the exe is if you don't include the space of the DLLs. At least that's what i think...

Wrong again

The reason you don't "count in DLLs" is that their code and data is shared between processes. What you need to do is get hold of Process Explorer (or use perfmon.msc which is included with 2k and XP), and look at the memory statistics counter called "Private Bytes".

This figure is the amount of, well, private bytes in your process. Memory not shared with other processes, memory that in low-memory situations will have to be paged out to disk and re-read, rather than discarded and re-read from .exe/.dll.

You make it as if everything not shared is paged to disk... This alone isn't true, last time i check. I was always told that information is only paged to disk when the programs with the highest priority at the time (the ones visible on the screen have second, first is the one on top, and third is the one who's not visible on the screen while the one with higher priority in the processes part of task manager gets higher than them. But i have a feelingthat which is in the parenthesis isn't 100% true but it's what i go on lol) are in the RAM and the paged programs go in order of lowest to highest priority.

25 Jul 2006, 17:42

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

Quote:

You make it as if everything not shared is paged to disk... This alone isn't true, last time i check. I was always told that information is only paged to disk when the programs with the highest priority at the time (the ones visible on the screen have second, first is the one on top, and third is the one who's not visible on the screen while the one with higher priority in the processes part of task manager gets higher than them. But i have a feelingthat which is in the parenthesis isn't 100% true but it's what i go on lol) are in the RAM and the paged programs go in order of lowest to highest priority.

Well, paging only happens in low-memory situations of course. Windows is a bit aggressive at working-set trimming though, which can give some not so logical paging even if you don't have a low-low memory situation.

You might want to check out "inside windows 2000" (or the later XP edition), it has some very good descriptions of what's going on inside windows, so you won't have to rely on incorrect information or your own flawed assumptions ^_^

25 Jul 2006, 18:18

kohlrak

Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad

kohlrak

Got a link to bookmark? lol Or is it in the useful links at the top of the forums? lol

25 Jul 2006, 18:46

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

It's a book, and available in ebook (CHM) form as well.

26 Jul 2006, 08:26

kohlrak

Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad

kohlrak

Where does the CHM work?

26 Jul 2006, 19:47

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

kohlrak wrote:

Where does the CHM work?

Rephrase, don't understand you.

_________________ - carpe noctem

27 Jul 2006, 10:20

okasvi

Joined: 18 Aug 2005
Posts: 382
Location: Finland

okasvi

kohlrak wrote:

Where does the CHM work?

CHM is help-file like format, and I believe windows supports it natively.

_________________When We Ride On Our Enemies support reverse smileys |:

27 Jul 2006, 14:27

kohlrak

Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad

kohlrak

i mean "live" not work. I musta been in some kinda hurry when typign ti. I know their format, there are lots of them included with fasm... o.O

27 Jul 2006, 20:28

okasvi

Joined: 18 Aug 2005
Posts: 382
Location: Finland

okasvi

kohlrak wrote:

i mean "live" not work. I musta been in some kinda hurry when typign ti. I know their format, there are lots of them included with fasm... o.O

Now I'm confused.

_________________When We Ride On Our Enemies support reverse smileys |:

27 Jul 2006, 20:40

f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark

f0dder

He probably means where he can leech a warez copy of inwin2k.chm... I bought the book

28 Jul 2006, 11:26

okasvi

Joined: 18 Aug 2005
Posts: 382
Location: Finland

okasvi

f0dder wrote:

He probably means where he can leech a warez copy of inwin2k.chm... I bought the book

oic, should have guessed

_________________When We Ride On Our Enemies support reverse smileys |:

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum