5

Obtain a maximum amount of memory used by a C program

 2 years ago
source link: https://www.codesd.com/item/obtain-a-maximum-amount-of-memory-used-by-a-c-program.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Obtain a maximum amount of memory used by a C program

advertisements

I recently started fiddling with programming in C. What I need to do is find the maximum amount of memory used by a program throughout the lifetime of the process. How can I do this easily on Windows? Basically a tool in the form of:

> memoryused myprogram.exe
> peak amount of memory used: 36 bytes

I don't really need to track memory usage at any given time during the execution of the process.


for this you need use GetProcessMemoryInfo

Related Articles

How to determine the amount of memory used by unmanaged code

I'm working against a large COM library (ArcObjects) and I'm trying to pinpont a memory leak. What is the most reliable way to determine the amount of memory used by unmanaged code/objects. What performance counters can be used?Use UMDH to get snapsh

Why does the amount of memory used increase even after the memory has been output?

I found that the amount of used memory increases even after the memory is released in my program. So I wrote two simple C++ test programs to verify it. #define NUM 1000000 void Test1() { PrintMemory("Test1 Beginning"); double* Data = new double[

Amount of memory used by each thread

I am developing an app that is crashing due to an excess of memory usage. I would like to know the amount of memory that is being used by each active thread so that I can decide which allocated or drawn in screen elements release or remove from view.

How to reduce the amount of memory used by the Sql connection pool in a C # program

I have a C# program which acts as a multi-threaded web server. It does lots of processing of Xml structures held in a Sql Server database. As the size of these Xml structures increases, I am finding the app running out of memory. I have deployed the

General rule of the amount of memory used to recycle a work process?

I've got a code base with lots of this: byte[] contents = FileUtils.FileToByteArray(FileOfGartantuanProportions); I don't control my IIS server, so I can't see the system log or do instrumentation, I just get to see my request fail to return (white p

What is the maximum amount of memory that a Flash movie can use in a browser?

I need to store a lot of data coming in from a server into memory, so I have to write my memory-storage algorithms based on how much I can safely use without hanging up or crashing the browser. Is there any safe size limit like 1MB or 100MB, that con

Maximum amount of memory per java process in Windows?

What is the maximum heap size that you can allocate on 32-bit Windows for a Java process using -Xmx? I'm asking because I want to use the ETOPO1 data in OpenMap and the raw binary float file is about 910Mb.There's nothing better than an empirical exp

How to clean memory & ldquo; & Rdquo; the applications determine the amount of memory used on iOS?

Every now and then "memory cleaner" apps bubble to the top of the download charts on the iOS AppStore, yet I am always puzzled: How can these apps figure out how much memory is used when they are sandboxed and can't access any memory outside of

How to limit the amount of memory used to store integers?

When I call sys.getsizeof(4), it returns 14. Assuming this is the same as sizeof() in C, this is unacceptably high. I would like to use the memory array like a big, raw array of bytes. Memory overhead is of the utmost priority, due to the size of the

Does Using Assign reduce the amount of memory used?

When I use assign when declaring a synthesized propery, does ARC automatically still create a matching ivar to it? My property is as follows @property (nonatomic, assign) NSString *text: And - (NSString *)text { return self.label.text; // label is a

Cocoa - How to programmatically retrieve the amount of memory used by your application?

I would like to know how much memory my application is using. How would I be able to retrieve this programmatically? Is there an easy Cocoa way to do this, or would I have to go all the way down to C? Thanks!Working snippet: struct task_basic_info in

Discover the amount of memory used by the script

in PHP I can use memory_get_usage(). Is there anything like that in nodejs? The memwatch library doesn't seem to provide that info, it only emits some events when a "leak" occursGet concerned object describing the memory usage of the Node proces

Why is the amount of memory used increasing?

private void Draw(){ int width = Screen.PrimaryScreen.Bounds.Width; int height = Screen.PrimaryScreen.Bounds.Height; Bitmap image= new Bitmap(width, height); Graphics gr = Graphics.FromImage(image); gr.CopyFromScreen(0, 0, 0, 0, new Size(width, heigh

How can I detect the amount of memory used for all controls on a form?

Suppose I have many controls on Windows Form. Is there any way to know how much memory is used for each control? Are there any free tools that can display the memory info? Thanks.What Are Some Good .NET Profilers?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK