473,508 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new and VirtualAlloc

200 New Member
Hello everyone,


I heard some points that the memory allocated by new does not belongs to virtual memory, and onlymemory allocated by VirtualAlloc belongs to virtual memory.

1.

I think this statement is not correct. Since all memory touched by current process belongs to virtual memory (either reserved or committed). No matter how (through which API) developer is using.

2.

And new always utilize VirtualAlloc in underlying internal implementation code, so new (in implementation point of view) will consume virtual memory -- the same as what VirtualAlloc does.

Are my points (1) and (2) correct?


thanks in advance,
George
Jan 13 '08 #1
9 1371
weaknessforcats
9,208 Recognized Expert Moderator Expert
Chapter 13 Windows vis C/C++ Jeffrey Richter 2008.
Jan 13 '08 #2
oler1s
671 Recognized Expert Contributor
I don't know. Well, I don't care to find out for you. Maybe the people here, here, here, and here may have an answer, especially since you asked them all the same question.
Jan 13 '08 #3
send2aansari
7 New Member
By calling new , memory is allocated in heap i.e RAM.
But by callinf VirtualAlloc, means allocating in virtual memory. when you wanna use it, then commit it.


Asadullah ansari
Jan 15 '08 #4
weaknessforcats
9,208 Recognized Expert Moderator Expert
By calling new , memory is allocated in heap i.e RAM.
Of course it's in RAM. The allocation is in the computer. However, by default, new calls VirtualAlloc() in Windows.

Please read Chapter 13 Windows vis C/C++ Jeffrey Richter 2008.
Jan 15 '08 #5
George2
200 New Member
Thanks weaknessforcats,


I agree and I think you mean the memory allocated by new belongs to virtual memory. Right?

Of course it's in RAM. The allocation is in the computer. However, by default, new calls VirtualAlloc() in Windows.

Please read Chapter 13 Windows vis C/C++ Jeffrey Richter 2008.

regards,
George
Jan 17 '08 #6
weaknessforcats
9,208 Recognized Expert Moderator Expert
Please read Chapter 13 Windows vis C/C++ Jeffrey Richter 2008.
Jan 17 '08 #7
weaknessforcats
9,208 Recognized Expert Moderator Expert
Please read Chapter 13 Windows via C/C++ Jeffrey Richter 2008.
Jan 17 '08 #8
George2
200 New Member
Looks like a pretty new book, I can not find it in local book store.


Please read Chapter 13 Windows via C/C++ Jeffrey Richter 2008.

regards,
George
Jan 18 '08 #9
weaknessforcats
9,208 Recognized Expert Moderator Expert
Looks like a pretty new book, I can not find it in local book store.
I got mine at Amazon.com.
Jan 18 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1868
by: vikram | last post by:
hello sir, plz have patience to read this looooong mail. i need to design a high speed recording system. the pci card has a plx chip which provides dma facilty for data transfer. for dma i need...
12
8087
by: Olaf Baeyens | last post by:
I am porting some of my buffer class code for C++ to C#. This C++ class allocates a block of memory using m_pBuffer=new BYTE; But since the class is also used for pointers for funtions that uses...
1
974
by: Lynn McGuire | last post by:
Is there a way to force the malloc in VC++ 2003 to use addresses above 0x12000000 for virtual memory ? You dont want to know why. It has to do with fortran common blocks. Thanks, Lynn
5
1712
by: AAVarda | last post by:
Hi, I have a device that scan's a doc and send's the doc image back. Below is the function in API to get the Image: ULONG MTMICRGetImage ( char *pcDevName, char *pcImageID, char *pcBuffer,...
2
2278
by: azerty | last post by:
Hello I use an old program "TeamManager 97" from Microsoft corp. which use Access dabase. before I upgrade my computer to XP SP2, every work fine (with 1 Go of memory) After I realise...
5
24599
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
3
3807
by: George2 | last post by:
Hello everyone, I heard some points that the memory allocated by new does not belongs to virtual memory, and onlymemory allocated by VirtualAlloc belongs to virtual memory. 1. I think...
1
372
by: George2 | last post by:
Hello everyone, On Windows, when we allocate large amount of memory, new will call VirtualAlloc directly, other than call HeapAlloc then through HeapAlloc call VirtualAlloc indirectly? ...
350
11457
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
4
5072
by: =?Utf-8?B?U2VyZ2Vp?= | last post by:
Dear staff Can I get your assistance with \3GB (LARGEADDRESSAWARE) switch in mixed mode process built by VS 2008, please? I have a mixed mode application: C# GUI calling native C++ DLL through...
0
7223
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
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
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
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
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...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.