473,586 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help!! How can I get the information of the memory used of a process??

Here is a part of my code:

internal bool Excute(string input)
{

ProcessStartInf o psi = new ProcessStartInf o();
psi.FileName = this.filePathTo Excute;

psi.RedirectSta ndardOutput = true;
psi.RedirectSta ndardError = true;
psi.RedirectSta ndardInput = true;
psi.UseShellExe cute = false;

Process p = new Process();
p.StartInfo = psi;

p.ErrorDataRece ived += new
DataReceivedEve ntHandler(p_Err orDataReceived) ;
p.OutputDataRec eived += new
DataReceivedEve ntHandler(p_Out putDataReceived );
p.Start();

//peakMemory = p.PeakWorkingSe t64;//It is the right place
to get the information of memory used by the process p here??

p.BeginOutputRe adLine();
p.BeginErrorRea dLine();

p.WaitForExit(2 000);

if (!p.HasExited)
{
p.ErrorDataRece ived -= new
DataReceivedEve ntHandler(p_Err orDataReceived) ;
p.OutputDataRec eived -= new
DataReceivedEve ntHandler(p_Out putDataReceived );

p.Kill();
p.Close();

return false;
}

excuteTime = p.TotalProcesso rTime;
peakMemory =p.PrivateMemor ySize64;//And again. It is the
right place to get the information of memory used by the process p
here??
/* NonpagedSystemM emorySize64=p.N onpagedSystemMe morySize64;
PagedMemorySize 64=p.PagedMemor ySize64;
PagedSystemMemo rySize64=p.Page dSystemMemorySi ze64;
PeakPagedMemory Size64=p.PeakPa gedMemorySize64 ;
PeakVirtualMemo rySize64=p.Peak VirtualMemorySi ze64;
PeakWorkingSet6 4=p.PeakWorking Set64;
PrivateMemorySi ze64=p.PrivateM emorySize64;
VirtualMemorySi ze64=p.VirtualM emorySize64;
WorkingSet64 = p.WorkingSet64;

*/ //Here are so many memory information related properties of the
process, and which one is the physical memory used by the process p??

p.Close();
}
Thank you very much!

A confused boy is lingering to find the information of physical memory
used by the process.

Nov 21 '06 #1
0 1464

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

Similar topics

1
1818
by: Avi Kak | last post by:
Hello: My apologies in advance for asking a question that probably has been raised numerous times already in this newsgroup. My Google search did not lead me to an answer I could use. Is there a Python module I could use to determine the actual amount of memory
7
2427
by: Rich Denis | last post by:
Hello, I have been trying to solve a mysterious memory leak problem and was hoping that you could help me out on my stuck point. First a bit of background. We have two app servers in an app center cluster that are each running a number of web applications. For some reason one of the boxes' asp_wp process keeps recylcing on us. It seems...
2
1917
by: Asfar | last post by:
Hi, I have a VS2005 windows program written in c#. In this program I have an array list which stores many DataTable's. When I first run the pogram the arraylist is loaded with datatables. At this point when the see the memory used by the program in task manager it is 135,654K. Now when I minimize the application the memory goes down to...
3
1576
by: Avi | last post by:
Hi all, In my program I need to know the memory used by certain applications. I was able to get the free available memory on the machine, but not the memory that is used by a specific application.
2
5716
by: Lyon | last post by:
Here is a part of my code: internal bool Excute(string input) { ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = this.filePathToExcute; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true;
1
2847
by: Andrew McLean | last post by:
I want to script the benchmarking of some compression algorithms on a Windows box. The algorithms are all embodied in command line executables, such as gzip and bzip2. I would like to measure three things: 1. size of compressed file 2. elapsed time (clock or preferably CPU) 3. memory used The first is straightforward, as is measuring...
5
587
by: Sune | last post by:
Hi all, I want to make data stored in-memory (not disk) available to several processes. My concern is that poorly written C applications with dangling pointers may(will) damage the data in this memory segment if it is open to all, i.e. shared memory mapped into all processes memory area. I don't want to use TCP/IP client/server between...
3
1872
by: mohi | last post by:
hello everyone , is there any cmmnd in gdb or any other way to find out whats the total dynamically allocated memory a process holds at various instances of execution??? and what can be the possible reasons of an error like glibc detected:malloc() memory corruption when the program executes almost the same function abt 2000 times with
3
3165
by: Salim Fadhley | last post by:
I'm trying to create a python unit-test which will test a complex program which includes a number of functions which have been implemented in C or C++. The unit-test needs to check that after the functions have been run a few thousand times all of the memory used by those functions has been un-allocated, i.e. that there are no memory leaks....
0
7911
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8200
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8215
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
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 we have to send another system
0
1179
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.