473,804 Members | 3,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime and OS report different mem usage

Hi
I am working on a pure managed windows application that creates large byte arrays at run time. In fact it creates a 50M byte array when the application starts

public static byte[] buffer = new byte[1024*1024*50]

I am using System.GC.GetTo talMemory() to monitor the memory usage. It is consistent with what I can imagine. The memory usage is a little bit above 50M. During runtime this application reads large files (between 25 to 46MB) but it does not reallocate buffer. Each time only one file can be processed and the above 50MB buffer is used

However, if I use Windows Task Manager/Processes and check the memory usage of this application, I see the memory usage is between 75 to 130 MB. This result in some serious diskswapping activities on a PC with 256MB memory

Do you know why there is a discrepency of mem usage between the runtime reports and what the OS reports

I am using .NET SDK1.1 on XP Pro and Win Server 2003

Thank you for your help
Jul 21 '05 #1
3 3248

"Geng Sheng" <an*******@disc ussions.microso ft.com> wrote in message
news:68******** *************** ***********@mic rosoft.com...
Hi,
I am working on a pure managed windows application that creates large byte
arrays at run time. In fact it creates a 50M byte array when the
application starts.

public static byte[] buffer = new byte[1024*1024*50];

I am using System.GC.GetTo talMemory() to monitor the memory usage. It is
consistent with what I can imagine. The memory usage is a little bit above
50M. During runtime this application reads large files (between 25 to
46MB) but it does not reallocate buffer. Each time only one file can be
processed and the above 50MB buffer is used.

However, if I use Windows Task Manager/Processes and check the memory
usage of this application, I see the memory usage is between 75 to 130 MB.
This result in some serious diskswapping activities on a PC with 256MB
memory.

Do you know why there is a discrepency of mem usage between the runtime
reports and what the OS reports?

I am using .NET SDK1.1 on XP Pro and Win Server 2003.
Thank you for your help.

What counters are you looking at in the Taskmanager?
The Taskmanager has no counter for the GC.GetTotalMemo ry value, so you are
actually comparing two different things.
If you need a consistent view of the memory consumption, start the
performance managed and look at the CLR Memory counters category.

Willy.
Jul 21 '05 #2
I am using Windows Task Manager\Process es by press control-alt-delete then choose "task list". It is a table with the following columns
Image Name, PID, CPU, CPU Time, Mem Usage

I then found the application process name and check the Mem Usage here. By the way, I tried to use PerfMon but I do not know how to enter a specific "Image Name" in those memory counters

On the other hand I am using System.Console to write out System.GC.GetTo talMemory(). That number is very different from what Task Manager reports. This is where the problem is, I do not know what caused the OS to allocate that much memory since I am not reallocating any big objects.
Jul 21 '05 #3
"Mem Usage" is the same counter as the "Working Set" size, that is the size
in bytes of the process pages actually mapped to RAM.
System.GC.GetTo talMemory() only returns the size of the GC heap, which is
only a part of the WS.

Without seeing a piece of code it's hard to tell what accounts for this high
WS usage.

Willy.

"Geng Sheng" <an*******@disc ussions.microso ft.com> wrote in message
news:AE******** *************** ***********@mic rosoft.com...
I am using Windows Task Manager\Process es by press control-alt-delete then
choose "task list". It is a table with the following columns:
Image Name, PID, CPU, CPU Time, Mem Usage.

I then found the application process name and check the Mem Usage here. By
the way, I tried to use PerfMon but I do not know how to enter a specific
"Image Name" in those memory counters.

On the other hand I am using System.Console to write out
System.GC.GetTo talMemory(). That number is very different from what Task
Manager reports. This is where the problem is, I do not know what caused
the OS to allocate that much memory since I am not reallocating any big
objects.'

Jul 21 '05 #4

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

Similar topics

0
4072
by: hem | last post by:
in my web application, i want to show dynamic images at runtime with crystal report.net. the image is residing in my local computer, i am having problem at runtime i.e. how i give the image path at runtime and load the different - different images at runtime. i need a quick assistance & help.
9
3600
by: Aaron Anodide | last post by:
Hello, I am using the following template class as a shorthand for zero-ing memory: template<class T> class ZeroMem : public T { public: ZeroMem(void)
0
1579
by: blackpuppy | last post by:
I need to allow the user to design the report format at runtime. I'm studying with what tools that I can do that. The users need to design the report/document by themselves because they are in different cities. They may have different names for the same report/document. And the format may need to be changed over time. Now I have the following options. - Crystal Report - Active Report
0
1327
by: Weby | last post by:
Hi, I've searched everywhere, but i've not found anything to make my application compatible with Access 2k Runtime. In fact, it works good for the first report i display. My application is able to launch a report in view mode, and the secretary needs to be able to compare 2 reports. I launch the runtime access using shell() as the Microsoft Knowledge base
0
1668
by: Corbin | last post by:
I've been going in circles on this for a week. Please help: I'm running a web app with ASP.NET 1.1 and Crystal Reports for .NET. The app has three reports, two of which are reliable both on my development machine and on my client's production server. The third report is reliable on my development machine, but not on the production server. I can think of nothing different about this third report that would cause it to be so fragile. ...
3
268
by: Geng Sheng | last post by:
Hi I am working on a pure managed windows application that creates large byte arrays at run time. In fact it creates a 50M byte array when the application starts public static byte buffer = new byte I am using System.GC.GetTotalMemory() to monitor the memory usage. It is consistent with what I can imagine. The memory usage is a little bit above 50M. During runtime this application reads large files (between 25 to 46MB) but it does not...
2
4234
by: rinmanb70 | last post by:
I have a QBF form/query and a report from the QBF that shows the results of the QBF. I would like to show the criteria on the report that was used in the QBF to get the info on report. I can't find how to do this except to show the "hard for users to understand" SQL WHERE statement. Anyone have a better way?
17
7674
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many do not, and it's not clear when they would get it. His thought was to use the upcoming Access 2007 runtime to allow the users who are still running Office 2003 to be able to run the database. While I use multiple versions of Access on my...
0
1957
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello Gurus, I need to create a Microsoft Visual Studio 2005 report at runtime. I wrote a C# window application, that holds a DataSet and several DataGridView controls. Each of the DataGridView controls show filtered data of the DataSet. Using the Visual Studio 2005 designer, I have generated RDLC file with report tables and a Form that holds this reports for display. and its all
0
9582
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9157
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7621
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
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
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2993
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.