about dwAllocationGranularity of SYSTEM_INFO

G

George2

Hello everyone,


I read the description of dwAllocationGranularity from,

1. http://msdn2.microsoft.com/en-us/library/ms724958.aspx

2. http://msdn2.microsoft.com/en-us/library/aa366887(VS.85).aspx

and tested on my system it is 65535.

But from the above description, I do not quite understand what does it
mean. Does it mean that when memory manager deals with real memory
allocation, it will always allocate 65535 bytes at a time, and divide
into small chunks to upper level API (for example, when we new[256],
it will allocate 256 bytes from the 65535 allocated raw bytes to
application)?

Another question is, what benefit will we get if we know this
parameter? For example, how do we allocate memory will utilize the
system at most to achieve best performance?


thanks in advance,
George
 
P

peter koch

Hello everyone,

I read the description of dwAllocationGranularity from,

1.http://msdn2.microsoft.com/en-us/library/ms724958.aspx

2.http://msdn2.microsoft.com/en-us/library/aa366887(VS.85).aspx

and tested on my system it is 65535.

But from the above description, I do not quite understand what does it
mean. Does it mean that when memory manager deals with real memory
allocation, it will always allocate 65535 bytes at a time, and divide
into small chunks to upper level API (for example, when we new[256],
it will allocate 256 bytes from the 65535 allocated raw bytes to
application)?

Another question is, what benefit will we get if we know this
parameter? For example, how do we allocate memory will utilize the
system at most to achieve best performance?

thanks in advance,
George


Hello George

I believe you to be the most persistent poster when it comes to asking
questions here at comp.lang.c++ and related groups, and I must admit
that it begins to annoy me a little bit. I would expect that you would
take some effort trying to find your answers for yourself.
But that is just me! What is far more annoying is that you also
persist in asking off-topic questions. You should know that the
question post above is not C++. So two bits of friendly advice:

*) Make an effort to find your own answers before posting here or
in another newsgroup.
*) Do not post these f***ing off-topic questions here.

/Peter
 
J

jkherciueh

George2 said:
I read the description of dwAllocationGranularity ...

That is not defined by the C++ standard. Information about it is off-topic
in this group. Please find a better forum for your question.


Best

Kai-Uwe Bux
 
J

jalina

George2 a écrit :
Hello everyone,


I read the description of dwAllocationGranularity from,

1. http://msdn2.microsoft.com/en-us/library/ms724958.aspx

2. http://msdn2.microsoft.com/en-us/library/aa366887(VS.85).aspx

and tested on my system it is 65535.

But from the above description, I do not quite understand what does it
mean. Does it mean that when memory manager deals with real memory
allocation, it will always allocate 65535 bytes at a time, and divide
into small chunks to upper level API (for example, when we new[256],
it will allocate 256 bytes from the 65535 allocated raw bytes to
application)?

No you did not understand. If you read at section 15.2 and 16.3, only
9999 bytes are allocated. Extra bytes to 1024, will be discarded because
cached. (sic: "Reserves a range of the process's virtual address space
without allocating any actual physical storage in memory or in the
paging file on disk.")
Another question is, what benefit will we get if we know this
parameter? For example, how do we allocate memory will utilize the
system at most to achieve best performance?

I don't know if this parameter will be ever useful to you since you even
do not know the use of newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top