memory usage question

C

Ciur Eugen

Hi !
If I will make

char* pHugeMemory = (char*)malloc( huge_number_of_bytes );

in some place of my program, and after some time my program will jump
to other processing place, that won't reference pHugeMemory location,
then if physical memory storage is full, I suppose Windows, will
discard lots of RAM memory pages to some swap place on my Hard Disk
drive... right ?
Now, if after some time I will refernce pHugeMemory, for reading, for
example, then Windows will discard ( may be ) , something else and for
sure will load all pHugeMemory back to physical memory.
Now Question:

Is there some win32 functions that could make me aware when my program
references pHugeMemory memory location ? I mean to make me aware of
when someone tries to read or write that location ?

More exactly :
that memory allocation is one XXX.DLL ( that is : allocated in
function exported from DLL ) that is shared among more then one
process.
I would like to make aware all other processes ( that have loaded
XXX.DLL ) when one process tries to read/write any located memory (
pHugeMemory ) from a function exported from that XXX.DLL.

Any suggenstions are welcome.
Thank you in advance.

PS:
If that don't make sense I will more accurate next time ;)
 
I

Ian Collins

Ciur said:
Hi !
If I will make

char* pHugeMemory = (char*)malloc( huge_number_of_bytes );

in some place of my program, and after some time my program will jump
to other processing place, that won't reference pHugeMemory location,
then if physical memory storage is full, I suppose Windows, will
discard lots of RAM memory pages to some swap place on my Hard Disk
drive... right ?

It might, to find out you should ask on a windows specific group.
Standard C++ doesn't include virtual memory management.
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Ciur said:
Is there some win32 functions that could make me aware when my program
references pHugeMemory memory location ? I mean to make me aware of
when someone tries to read or write that location ?

Win32 has a lot of virtual memory management functions. Ask in any windows
programming related group, this is off-topic here.
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top