Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

Memory usage question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenea Ciur - 28 Jul 2006 07:50 GMT
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:
 I that don't make sense I will more accurate next time ;)
Bruno van Dooren [MVP VC++] - 28 Jul 2006 10:30 GMT
> 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.

Unless that memory is shared memory (which it isn't, from your description)
each process has its own memory allocation in its own memory context.

The fact that you allocate it inside the dll does not make it shared memory.
See here for an explanation of how to use shared memory on windows.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/file_
mapping.asp


Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.