473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Memory usage question

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 ;)

Jul 28 '06 #1
1 1059
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/de...le_mapping.asp

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Jul 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom | last post by:
We have a VERY simple .NET C# Form Application, that has about a 23MB Memory Footprint. It starts a window runs a process and does a regular expression. I have done a GC.Collect to make sure that,...
3
by: Ian Taite | last post by:
Hello, I'm exploring why one of my C# .NET apps has "high" memory usage, and whether I can reduce the memory usage. I have an app that wakes up and processes text files into a database...
7
by: George Gre | last post by:
Hi, I wrote a c# programme that listens to incoming TCP requests and services them. This programme is meant to be running as long as the server its installed on is running. So we assume for...
4
by: Douglas | last post by:
Hi, Any suggestions for estimating the amount of memory a program will use in advance, before it is run. Rules of thumb etc.? Is it then possible to warn a user that a program is likely to...
5
by: SDS | last post by:
I am writing an ASP.NET application (in C#) that, as part of a particular response, populates a MemoryStream object with binary data that is being collected from a Process object's StandardOutput. ...
8
by: TheB | last post by:
Ok, lets try this again. I have a program which searches all disk drives for certain file types. When it finds a file it writes a record to a Firebird DB. The program normally is using 40 - 44...
7
by: Raj | last post by:
Hi Guys, We are on db2 udb v8.2 64 bit,partitioned (5 nodes) on AIX 5.2 ( intra parllelism is enabled). I have a question, i am trying to find the memory usage on my production machine, we...
11
by: Rares Vernica | last post by:
Hi, What is the right way/tool to find the peak memory usage of a C++ program? I tried Valgrind but is does not seem to be able to answer my question. Thanks a lot, Ray
3
by: crazy420fingers | last post by:
I'm running a python program that simulates a wireless network protocol for a certain number of "frames" (measure of time). I've observed the following: 1. The memory consumption of the program...
1
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.