473,772 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

huge memory useage

Hallo. I started a solution in VS.NET with template for C# windwos
application. The solution has several projects:
-Artifacts
-BusinessRules
-Client
-ErrorLog
-Standardization
....
...
..
When application is stared you can see only one form with 4 userControls
included on it. Each user control contains:
- toolbas user control : 4 combo controls + 2 buttons
- image user control: kodak image edit control + 6 buttons
- data entry user control: 3 listviewz, 10 buttons, 6 edit controls, 1 combo
- view list control: 1 list view control
and few buttons on form

I don't use unmanaged variables in appilcation so I expect GC to do work for
me and take care about destroing the objects.
When I start that exe assembly I got process in memory for this application
~32MB.
Is this memory usage for this kind of application normal!? For me it's looks
like too much memory. When I load image in kodak control process grows to
~45MB.
Where I'm wrong!? I don't think that tis useage of memory is normal even for
..NET app.
When I minimize app process gets unbelivable 600KB of memory useage. What's
going on!?

Would you help me please and tell me how to limit this 45MB to something
smaller and how to use GC when I use only managed variables!? Should I
derive all Artifacts, Businessruless and Standardization classes from
IDisposable and override Dispose method for all classes which I will call
after I finished with some object from that classes?

regards
Vasko
Nov 15 '05 #1
7 2082
Jax
Considering I have 2 IE instances running at 24,000K a piece, I dont think it's that unusual.
Nov 15 '05 #2
"Vasil Buraliev" <ph*****@mol.co m.mk> wrote in message
news:OX******** *****@tk2msftng p13.phx.gbl...
When I start that exe assembly I got process in memory for this application ~32MB.
Is this memory usage for this kind of application normal!? For me it's looks like too much memory.


Yes... Coming from the 64K RAM computer days this is pretty shameful.

It would be interesting to see the behavior on different machines with
diferent RAM sizes. It seems that the CLR just grabs a substantial amount of
the available RAM and then distributes that amount among the running managed
applications. This is not necessarily bad, it may be a performance
optimization. You could also try and start several versions of the same
application, you may see the memory used per application decrease.

I am only speculating though but it seems like a reasonable approach. The
CLR is, as far as memory management is concerned, an OS within the OS and
may assign resources to an app generously as long as they're not scarce. And
you don't have to be aware of the requests for memory going on, the form or
some control may be overasking in anticipation somewhere deep down in the
tree. The memory is waisted anyway if it isn't assigned to any process. I am
interested to read if there is any truth to my assumption.

Martin.
Nov 15 '05 #3
Hi Martin,
thank you for your idea.
I started 5 instance of Application and the memory was variate. Probably GC
did something. But in general the size of the application it was big. The
objects that I use in the applicatin and list of objects are preaty huge.
Anyhow... I think you will be interesting to read an descusion from
microsoft.publi c.dotnet.framew ork.performance with Subject: GC does not
release memory...memory keeps growing!!!!

regards
Vasko

"Martin Maat [EBL]" <du***@somewher e.nl> wrote in message
news:10******** *****@corp.supe rnews.com...
"Vasil Buraliev" <ph*****@mol.co m.mk> wrote in message
news:OX******** *****@tk2msftng p13.phx.gbl...
When I start that exe assembly I got process in memory for this application
~32MB.
Is this memory usage for this kind of application normal!? For me it's

looks
like too much memory.


Yes... Coming from the 64K RAM computer days this is pretty shameful.

It would be interesting to see the behavior on different machines with
diferent RAM sizes. It seems that the CLR just grabs a substantial amount

of the available RAM and then distributes that amount among the running managed applications. This is not necessarily bad, it may be a performance
optimization. You could also try and start several versions of the same
application, you may see the memory used per application decrease.

I am only speculating though but it seems like a reasonable approach. The
CLR is, as far as memory management is concerned, an OS within the OS and
may assign resources to an app generously as long as they're not scarce. And you don't have to be aware of the requests for memory going on, the form or some control may be overasking in anticipation somewhere deep down in the
tree. The memory is waisted anyway if it isn't assigned to any process. I am interested to read if there is any truth to my assumption.

Martin.

Nov 15 '05 #4
"Martin Maat [EBL]" <du***@somewher e.nl> wrote in
news:10******** *****@corp.supe rnews.com:
"Vasil Buraliev" <ph*****@mol.co m.mk> wrote in message
news:OX******** *****@tk2msftng p13.phx.gbl...
When I start that exe assembly I got process in memory for this
application ~32MB. Is this memory usage for this kind of application
normal!? For me it's looks like too much memory.


If you're using task manager to get your numbers, your numbers are wrong
(search for working set size to see the other millions of answers).
It seems that the CLR just grabs a substantial
amount of the available RAM and then distributes that amount among the
running managed applications.


No, no, no. Windows manages the WSS for a process. Doing it yourself will
almost certainly lead to poorer performance. There's a CLR loaded for each
managed application. What you're seeing is the initial cost of loading (JIT
et al) and then Windows leaving the WSS big (because you may need the
memory again in the future).

Mark
Nov 15 '05 #5
"Vasil Buraliev" <ph*****@mol.co m.mk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I started 5 instance of Application and the memory was variate. Probably GC did something. But in general the size of the application it was big. The
objects that I use in the applicatin and list of objects are preaty huge.
Anyhow... I think you will be interesting to read an descusion from
microsoft.publi c.dotnet.framew ork.performance with Subject: GC does not
release memory...memory keeps growing!!!!


That was quite a thread. I learned the following that may apply in your
situation as well.

1. If you are encountering these problems you should try to re-use objects
if possible instead of recreating them. If objects are recreated all the
time and the GC doesn't instantly clean up after you for some reason you,
memory use is likely to grow needlessly. Also, if you are keeping references
without being aware of it, re-using the same object will prevent anything
more than that one object to remain. and use memory.

2. For certain types of object it is "behavior by design" to allocate chunks
of 64 MB. It seems odd to me as well but it seems to be somewhat normal and
Microsoft considers bringing it down to 16 MB "a fix":
"This hotfix adjusts the allocation size for the large
object heap segments from 64 megabytes (MB) per segment to 16 MB."
http://support.microsoft.com/default...b;en-us;833610

3. Task manager does not provide reliable information about managed
applications. I've seen different explanations on the matter and they
weren't all consistent but there seem to be some issues with it that may
give you the wrong idea so you should use performance counters instead.

4. Most of the troubled applications seem to use ADO.NET. This would be the
first think to suspect if I were to encounter these issues. There may be
some read-ahead logic or other anticipating sceme at work. Try the code
without referencing ADO.NET natspaces and see the difference.
Then I heard of some tool called FxCop. It analyses your code and gives you
pointers as to how your code could be optimized. It may catch some improper
construct that causes your problem.

http://msdn.microsoft.com/msdntv/epi...M/manifest.xml
http://www.gotdotnet.com/team/fxcop/

Martin.
Nov 15 '05 #6
Thank you Marting for yor useful information.
I will get FxCop and try to find which objects still and hold most of the
memory.

best regards.
Vasko

"Martin Maat [EBL]" <du***@somewher e.nl> wrote in message
news:10******** *****@corp.supe rnews.com...
"Vasil Buraliev" <ph*****@mol.co m.mk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I started 5 instance of Application and the memory was variate. Probably GC
did something. But in general the size of the application it was big. The objects that I use in the applicatin and list of objects are preaty huge. Anyhow... I think you will be interesting to read an descusion from
microsoft.publi c.dotnet.framew ork.performance with Subject: GC does not
release memory...memory keeps growing!!!!


That was quite a thread. I learned the following that may apply in your
situation as well.

1. If you are encountering these problems you should try to re-use objects
if possible instead of recreating them. If objects are recreated all the
time and the GC doesn't instantly clean up after you for some reason you,
memory use is likely to grow needlessly. Also, if you are keeping

references without being aware of it, re-using the same object will prevent anything
more than that one object to remain. and use memory.

2. For certain types of object it is "behavior by design" to allocate chunks of 64 MB. It seems odd to me as well but it seems to be somewhat normal and Microsoft considers bringing it down to 16 MB "a fix":
"This hotfix adjusts the allocation size for the large
object heap segments from 64 megabytes (MB) per segment to 16 MB."
http://support.microsoft.com/default...b;en-us;833610

3. Task manager does not provide reliable information about managed
applications. I've seen different explanations on the matter and they
weren't all consistent but there seem to be some issues with it that may
give you the wrong idea so you should use performance counters instead.

4. Most of the troubled applications seem to use ADO.NET. This would be the first think to suspect if I were to encounter these issues. There may be
some read-ahead logic or other anticipating sceme at work. Try the code
without referencing ADO.NET natspaces and see the difference.
Then I heard of some tool called FxCop. It analyses your code and gives you pointers as to how your code could be optimized. It may catch some improper construct that causes your problem.

http://msdn.microsoft.com/msdntv/epi...20031204FxCopM
M/manifest.xml http://www.gotdotnet.com/team/fxcop/

Martin.

Nov 15 '05 #7
Hi,

This is Baskar here.

I have explained our problem below, please read this and help us to get it done.

We are developing a statistical project.

Development environment specification is given below

Hardware :

· Pentium III with 256 MB Ram, 20 GB H.D

Software :

· Microsoft Windows 2000
· Microsoft .net
We are having around 50 Forms, 13 Classes and 17 Modules in out product. Out problem is if we run our application it is taking round 30 MB Memory, because of this clipboard function (cut, copy & paste) is not working in none of the application.
Please help us to solve this problem

Your immediate reply will help us to get it done as early as possible

Anticipating your reply

With regards

Baskar C.G


*************** *************** *************** *******
Ohkawa Mould Designs&Enginee ring Pvt Ltd
(SoftwareDivisi on)
#1521,39 F-Cross 4-T Block
JayaNagar Banglore INDIA
Ph:+91-080-6552616
Fx:+91-080-6656530
Email:oh*****@v snl.com
Visit us @ www.ohkawasoft.com
*************** *************** *************** ***
Nov 15 '05 #8

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

Similar topics

31
9827
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily print all that to the screen, but PHP has to hold it in memory. Run some operations on it, or, more likely, have an array that you keep adding things to, and very soon you run into the 8 meg limit that is the default limit for PHP scripts. ...
2
3346
by: Mike Peretz | last post by:
I am trying to optimize my C# program, but no matter what I try the application keeps eating memory. I verified all the references and even got special software to count references. I made sure all the reference count reaches zero for all the objects that are no longer used. I also call Dispose as much as possible. Regardless, the memory is not freed. Even if I force the GC, some memory gets freed but not much.
0
1286
by: Leon | last post by:
I noticed that any running .NET window application including .Net Visual Studio, when GUI is not minimized and keped running for long time, the memory useage of its could be high, but, when it is minimized the memory useage will be immedictely drop down. I think this is where .Net garbage collection takes place. I am wondering if you can correct on this, and also give me some hints with what are possible ways if I want keep the memory...
7
25976
by: trialproduct2004 | last post by:
Hi all I am having application in c# where i am loading one table of database into dataset. My table is of large size. so whenever i am loading that into dataset my memory size is getting increased. So what i want is as soon as i am setting dataset to null, memory should be released. But when i am looking into task manager for memory useage what i am
6
3807
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
3
3010
by: RD | last post by:
I have a VBV.NET application that runs on a timer to do a job at one hour intervals. Basically the sequence is as follows the timer event fires 1- the timer get turned off 2- the code then checks to see if we're just changed hour from when the previous transfer session took place IF yes the code executes an FTP transfer from an FTP site. When the transfer is completed the file received is parsed (it's a comma
8
1873
by: Bob Dufour | last post by:
We got a windows form application that we wrote in VB.Net. Essentially its a manager for a list of persons and their contacts and some other info about the persons. No rocket science but lots of textboxes and comboxes to use lookup lists, some tab controls allow viewing of data about a person in logical groupings. We find that as we load the app with only a few hundred records of data in a lookup list (Rough estimate of data only at...
7
1536
by: vfunc | last post by:
Is it possible to restrict the memory available to a class where say for example it contains an array of elements of varying size or variable size list or a mix of these? Is the normal way to do this, to record the useage as new elements are declared and then compare this useage to an upper limit?
13
5457
by: fAnSKyer/C# newbie | last post by:
My system has 4GB memory and My program in C# is really memory consuming. and I noticed that when the memory I used is more than 2GB I will get an exception. How to solve this? thanks a lot
0
9621
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9454
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
10264
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...
0
10106
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
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
5355
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
4009
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
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
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.