473,396 Members | 1,767 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,396 software developers and data experts.

abnormal memory occupation?

Hi,

I have a simple windows application, it doen't have any form, or
expensive resource, just a simple exe. Its size compiled in release mode
is approximately 23KB. But when I run it, its size on memory is approx
12MB (megabyte!!!). Here is a simplified version of the code, I'll be
more than happy if you could tell me is this normal, or what can cause
the problem

Thanks
using System.Text;
using System.IO;
using System.Collections.Specialized;
using System.Web;
using System.Threading;

public class AutoBuy
{
public static void Main()
{
while ( true )
{
CommTest.GetData();
Thread.Sleep(3000000);
}
}
}
public class CommTest
{
public static void GetData()
{
//... declaration of 3 string
HttpWebRequest hreq = CreateKocGETRequest();
//mark1
HttpWebResponse hresp = (HttpWebResponse) req.GetResponse();
StreamReader respReader = new
StreamReader(hresp.GetResponseStream());
rstring = respReader.ReadToEnd();
respReader.Close();
hresp.Close();
//mark2

hreq = CreateKocPOSTRequest("login.php", ckyString,
byteArray);

//again mark1 to mark2 with different data, nothing
//special

}

public static CookieCollection GetCookies(WebHeaderCollection
hdCol)
{
//a function which extracts 3 cookies from header files
//works only with int and string's

return ckyCol;
}

public static string GetHash(string s)
{
//another function just with ints and strings

return astring;
}

public static HttpWebRequest CreateKocGETRequest()
{
HttpWebRequest KocReq = (HttpWebRequest)
WebRequest.Create("http://www.temp.com");
//sets 5 five properties

return KocReq;
}
public static HttpWebRequest CreateKocPOSTRequest(string path,
string ckyString, byte[] postData)
{
HttpWebRequest KocReq = (HttpWebRequest)
WebRequest.Create("http://www.temp.com/" +
path);

//sets 7 properties with strings
return KocReq;
}
}
Nov 16 '05 #1
6 1366
Hello Ziphyre

This is caused by the CLR thats responsible for loading the required
application. Currently there's a footprint of about 12 MB, but if I
understand Jason Zander from the CLR team correctly, this is something
they're working on (as well as startup times).

Not sure it'll be better with .NET 2.0, but I'm sure they're doing their
very best (in all aspects of the .NET framework actually).

--
venlig hilsen / with regards
anders borum
--
Nov 16 '05 #2
Strictly speaking, the minimum working set footprint of the CLR is more like
5.5MB, in my experience.

However, that goes up as soon as you start using certain bits of the .NET
Framework. There are lots of pieces of it that have a substantial hit as
soon as you use them. Windows Forms, for example.

So 12MB is not unusual for a Windows forms application that does nothing.

--
Ian Griffiths - http://www.interact-sw.co.uk/iangblog/
DevelopMentor - http://www.develop.com/

"Anders Borum" <an****@sphereworks.dk> wrote:

This is caused by the CLR thats responsible for loading the required
application. Currently there's a footprint of about 12 MB, but if I
understand Jason Zander from the CLR team correctly, this is something
they're working on (as well as startup times).

Not sure it'll be better with .NET 2.0, but I'm sure they're doing their
very best (in all aspects of the .NET framework actually).

Nov 16 '05 #3
Ziphyre <no****@yahoo.com> wrote:
I have a simple windows application, it doen't have any form, or
expensive resource, just a simple exe. Its size compiled in release mode
is approximately 23KB. But when I run it, its size on memory is approx
12MB (megabyte!!!). Here is a simplified version of the code, I'll be
more than happy if you could tell me is this normal, or what can cause
the problem


That sounds a little high, but not huge. There's a significant initial
memory use in .NET (even a program which *just* sleeps for 10 seconds
takes about 3.5MB on my box) but you should find that as your program
gets larger, your memory requirements don't go up by much more than you
expect - in other words, there's a large initial usage, but it's not
particularly inefficient in terms of actual data.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
Thanks for the answers, i was pretty sure that somethings were wrong but
it's quite reasonable when you put it that way

thanks again

Ziphyre wrote:
Hi,

I have a simple windows application, it doen't have any form, or
expensive resource, just a simple exe. Its size compiled in release mode
is approximately 23KB. But when I run it, its size on memory is approx
12MB (megabyte!!!). Here is a simplified version of the code, I'll be
more than happy if you could tell me is this normal, or what can cause
the problem

Thanks

Nov 16 '05 #5
And to add what others said, don't ever compare file size of your assembly
with memory consumption, both are not related.

Willy.

"Ziphyre" <no****@yahoo.com> wrote in message
news:30*************@uni-berlin.de...
Thanks for the answers, i was pretty sure that somethings were wrong but
it's quite reasonable when you put it that way

thanks again

Ziphyre wrote:
Hi,

I have a simple windows application, it doen't have any form, or
expensive resource, just a simple exe. Its size compiled in release mode
is approximately 23KB. But when I run it, its size on memory is approx
12MB (megabyte!!!). Here is a simplified version of the code, I'll be
more than happy if you could tell me is this normal, or what can cause
the problem

Thanks

Nov 16 '05 #6
The footprint in v2.0 is a bit higher, because the modules loaded are
getting larger in v2.
The good news is that much of the Framework is now mapped to shared pages,
which considerably reduces total memory consumption when multiple .NET
applications are loaded.

Willy.
"Anders Borum" <an****@sphereworks.dk> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
Hello Ziphyre

This is caused by the CLR thats responsible for loading the required
application. Currently there's a footprint of about 12 MB, but if I
understand Jason Zander from the CLR team correctly, this is something
they're working on (as well as startup times).

Not sure it'll be better with .NET 2.0, but I'm sure they're doing their
very best (in all aspects of the .NET framework actually).

--
venlig hilsen / with regards
anders borum
--

Nov 16 '05 #7

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

Similar topics

2
by: John Pote | last post by:
Running my programme in Python 2.3.4 I received the following msg in the consol :- (Pent III running W2K prof) """ Exception in Tkinter callback Traceback (most recent call last): File...
3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
4
by: Joe Lester | last post by:
I'm getting this message on Postgres 7.4.1 (Mac OS 10.3) 2004-05-24 15:20:15 WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded...
16
by: PyDenis | last post by:
Today, I found strange error while using py2exe: 1. I wrote simple program and save as 1.py: import win32ui import win32con win32ui.MessageBox('Test messageBox.' , 'Test', win32con.MB_OK |...
3
by: Jorge | last post by:
Hello. I use the following instructions to create and to show the "forms": Form_Exportar Ficha = new Form_Exportar(); // Project has form_exportar Ficha.ShowDialog(); Ficha.Dispose(); ...
9
by: ehabaziz2001 | last post by:
I am facing that error message with no idea WHY the reason ? "Abnormal program termination" E:\programs\c_lang\iti01\tc201\ch06\ownarr01o01 Enter a number : 25 More numbers (y/n)? y...
1
by: Michael Brockhoff | last post by:
Hello NG, I'am working an a aspx 2.0 page for a small Hotel. I'am looking now for a control where the user can see when the Hotel is occupied and when not. I need the overview for one year. ...
6
by: k3xji | last post by:
Hi all, Is there anyway to detect abnormal interpreter shutdown like (closing from task manager, power shutdown of the PC..etc)? Regards,
0
by: neovantage | last post by:
Hey all, I am working on a page which list categories in box format. I want to show the child categories of the parent category and the items under child category. I am using thickbox technology for...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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,...

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.