Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 21st, 2005, 09:54 AM
Registered User
 
Join Date: Mar 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to know how much Memory Consuption.....

Hi All,
pls anybody can tell about how to find out how much memory is occupied by a complete application( C or C++ ), from starting of main() function to end of main(). I find some code to calculate CPU Time taken by the program, but not for Memory consuption. pls help me....

Thanyou in advance...

Regards

Subhash.K
Reply With Quote
  #2 (permalink)  
Old March 22nd, 2005, 12:43 PM
Authorized User
 
Join Date: Oct 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ealkurabi
Default

im not quite sure but if i recall its in the book i am reading learn C++ in 24 incriments. i think just the start out it just a simple 1...

Reply With Quote
  #3 (permalink)  
Old March 24th, 2005, 01:15 AM
Authorized User
 
Join Date: Mar 2005
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Alan-LB Send a message via Yahoo to Alan-LB
Default

The memory used by the program will vary as the program executes.

First the .EXE file (that is the executable program file) will occupy a certain amount of memory. You can find this out by doing a DIR listing and seeing now big the file is. This will contain space for your program code and the global variables and constants that you declare.

Second, memory on the stack will be allocated and deallocated as the various functions in your program execute and use local variables.

Third, if you use the heap memory, this will be allocated and deallocated as you use the NEW and DELETE keywords.

The IDE that you are using may also give you statistics on your program that may help.

Alan


Reply With Quote
  #4 (permalink)  
Old October 14th, 2006, 11:34 PM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kpk_1231
Default

Dear Mr. Subash,
Praveen Here i am also searching for the same as U R searching.
"how to find out how much memory is occupied by a complete application( C or C++ ), from starting of main() function to end of main()."
could U pls send the code you have written to calculate CPU Time taken by the program. Pls send the acknowledge for this mail. I will be waiting eagarly for Ur reply.

Thanks & Regards
Praveen Kumar K.

Please contact to:
Praveen Kumar K.
Firmware Engineer,
Optiwave photonics Ltd
plot#70,Road#10,IDA,
Mallapur,
Hyderabad
A.P-500076
India
Mobile No.09866472772
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory akkad C# 2005 3 January 10th, 2007 04:46 AM
Memory akkad C# 0 January 9th, 2007 10:01 AM
Out of Memory ocabrera70 Classic ASP Components 0 February 15th, 2006 09:08 PM
How to know Memory Consuption..... subhash_w BOOK: Professional C++ 1 June 18th, 2005 08:13 AM
Out of memory : simplyAns All Other Wrox Books 0 November 9th, 2004 08:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.