473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Why my C# helloworld program use 16Mb of RaM ?

and how to fix it ?
Nov 16 '05 #1
9 1198
That was not an easy question, elpako.
A bit more specific, maybe?
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"elpako" <el*************@op.pl> wrote in message
news:ch**********@nemesis.news.tpi.pl...
and how to fix it ?

Nov 16 '05 #2
elpako,

There is nothing to fix really. This is the price that is paid for the
services that the Common Language Runtime provides. This memory is used for
things like memory management, garbage collection, etc, etc.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"elpako" <el*************@op.pl> wrote in message
news:ch**********@nemesis.news.tpi.pl...
and how to fix it ?

Nov 16 '05 #3
Hi,

If you search the archives you will see that this is a recurrent question
in the NG.

That is the amount of memory needed for all the managed code you are using,
also IIRC it also include some heap memory that is not being used but is
reserved in case you need it.

Beside all 16MB in today computers is not a big deal after all.

Jon:
Maybe this is something to include in the FAQ , what is the minimun and
why/how it's used.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"elpako" <el*************@op.pl> wrote in message
news:ch**********@nemesis.news.tpi.pl...
and how to fix it ?

Nov 16 '05 #4
Hi elpako,

I might add that even though the initial memory requirement seem high, adding a bunch of code to your program won't increase the memory usage much (depending of course on the code). Only a small part of that 16mb is actually your program, and most of that is used by the GUI.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #5
<"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT
dot.state.fl.us>> wrote:
Jon:
Maybe this is something to include in the FAQ , what is the minimun and
why/how it's used.


Good plan. Any suggested fully worded answers welcome - otherwise I'll
add it to my list of things to do when I have time :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6
elpako wrote:
and how to fix it ?


who says it's broken?

Jamie
Nov 16 '05 #7
Please be more specific, what memory consumption are you talking about, what
counters are you refering to?
Is your simple "Helloworld" program a console program or a winforms program?

Willy.

"elpako" <el*************@op.pl> wrote in message
news:ch**********@nemesis.news.tpi.pl...
and how to fix it ?

Nov 16 '05 #8
Your program does not "use" 16Mb of ram. That amount is simply reserved by
..NET for faster memory management. If you fill up your RAM .NET will switch
to a more agressive memory management mode and the amount of memory reported
by the task manager will probably go down a lot, down to 1-2Mb probably.

Etienne Boucher
Nov 16 '05 #9
This makes no sense as long as you don't specify what memory space (what
memory perf. counter or taskman counter) you are talking about.
Also, .NET doesn't manage process memory, the CLR only manages it's private
heaps such as the GC heap(s). The process memory is managed by the OS memory
manager.
If you ever have seen a managed application that only takes 1-2 Mb (Working
set) it is because :
1. it is a minimized winforms app. or
2. the system is overloaded and the memory manager has started to trim all
processe's working sets. At this point the system starts thrashing and UI
style applications tend to freeze.

Willy.
"Etienne Boucher" <et*****@novat.qc.ca> wrote in message
news:Ov**************@TK2MSFTNGP14.phx.gbl...
Your program does not "use" 16Mb of ram. That amount is simply reserved by
.NET for faster memory management. If you fill up your RAM .NET will
switch to a more agressive memory management mode and the amount of memory
reported by the task manager will probably go down a lot, down to 1-2Mb
probably.

Etienne Boucher

Nov 16 '05 #10

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

Similar topics

2
by: Ringbearer | last post by:
i'm trying to compile the vb helloworld program that's presented in the online library. when i try to run the build.bat file, i get the following error C:\Program Files\Microsoft.NET\SDK\v1.1...
15
by: ben | last post by:
When I try to gcc the following Helloworld program: #include <iostream> int main() { using namespace std; cout << "Hello, World!!\n"; return 0; }
2
by: carolineb2005 | last post by:
I have compiled this simple program which accept arguments on line using System; class HelloWorld { public static void Main(string args) { Console.WriteLine("Hello ", args); } }
1
by: Hayato Iriumi | last post by:
I guess I'm going through initiation while I try to get into C++. I can't even compile a Hello World app. Here is the code... #include <iostream> using namespace std; void main() { cout <<...
3
by: Mister.programmer | last post by:
Hi, I can't compile anything with vbc, so i am asking for help please. I have a file helloworld.aspx written in asp.net using vb, here it is: <script runat="server" language="vb">...
1
by: Thom Little | last post by:
I am trying to create the HelloWorld web service on localhost and consume it from a separate project (C# code behind) on local host. I created the service, executed WSDL, and executed CSC to...
9
by: Richard Lionheart | last post by:
Hi All, I've got Visual Studio .Net installed, but I don't know it very well. So I tried to create a plain old Win32 using the command-line complier. I tried to compile: ************...
1
by: å¼ æ²ˆé¹ | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2,...
4
by: devgupta01 | last post by:
Hi all, I have simple program- "HelloWorld.java" to run at eclipse. Java Version 1.4.2 Eclipse Version 3.2 class HelloWorld { public static void main(String aa) {
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.