473,546 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET eats memory like a pig

I know everything about reference counting and making sure you don't have
large objects lying around. I have also profiled my app with multiple tools.
I know about the fact GC collects memory but not necessary give it back to
the OS.

It seems that .NET win app will only return memory to the OS when the OS is
asking for it. But!!! When the OS is asking for it is usually too late, tons
of swapping and slow performance.

I just don't get it, how can .NET a superior technology is eating so much
RAM? I see that some people force their app to minimize or trim their
workspace just to free the memory - that is a bad idea. Other people unload
a application domain to save memory... a little better but still lots of
work just to get some memory back to the OS.

Some people tell me it is the price to pay for a runtime. Sorry, I have used
other runtimes for windows applications and they don't eat so much memory.
For the love of god, AcuCobol runtime does not take so much RAM (not that I
want to code in COBOL now)

At the end, it seems it is like running an OS within an OS. I am frustrated
that a stupid windows application can take 20M for doing nothing, and if you
have an app that does a little more stuff, it can take 40M and you have to
worry about each Dispose and reference so it will not jump to 100M.

and I am not alone with this problem....

http://www.dotnet247.com/247referenc.../14/73033.aspx



Aug 13 '05 #1
9 2333
Well, from your comments it sounds like you might not fully understand how
memory is managed in .NET. .NET does NOT use reference counters like COM
applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code, you
get poor performance. I'd start by examine your code and make sure you are
calling Dispose on any object that uses unmanaged resources, call Close on
any object that is opened, manage any multi-threading you may be doing with
a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be
using, set the ASPCompat property of ASP.NET pages to True when using COM
objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing in
that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
I know everything about reference counting and making sure you don't have
large objects lying around. I have also profiled my app with multiple
tools.
I know about the fact GC collects memory but not necessary give it back to
the OS.

It seems that .NET win app will only return memory to the OS when the OS
is
asking for it. But!!! When the OS is asking for it is usually too late,
tons
of swapping and slow performance.

I just don't get it, how can .NET a superior technology is eating so much
RAM? I see that some people force their app to minimize or trim their
workspace just to free the memory - that is a bad idea. Other people
unload
a application domain to save memory... a little better but still lots of
work just to get some memory back to the OS.

Some people tell me it is the price to pay for a runtime. Sorry, I have
used
other runtimes for windows applications and they don't eat so much memory.
For the love of god, AcuCobol runtime does not take so much RAM (not that
I
want to code in COBOL now)

At the end, it seems it is like running an OS within an OS. I am
frustrated
that a stupid windows application can take 20M for doing nothing, and if
you
have an app that does a little more stuff, it can take 40M and you have to
worry about each Dispose and reference so it will not jump to 100M.

and I am not alone with this problem....

http://www.dotnet247.com/247referenc.../14/73033.aspx



Aug 14 '05 #2
Mike,

Net is not designed for a Commodore 64. Even the current PDA's have more
memory than those.

Don't try to put methods used for computers as the Commodore 64 in this
century.

I have programmed for computers where I had to win a single byte to get what
I wanted, I am lucky that is not necessary anymore and in this century
everything to release unused memory will be done using the managed code by
instance with Net.

I find the method that you only use processing time if it is needed the best
one.

To give a methaphor, I know people who are defragmentating there disk every
hour. If you do that as well, fine however probably not the most productive
one.

Just my opinion.

Cor
Aug 14 '05 #3
Thre is no code!

Just write a win form app that connects to Access or SQL server, open the
connection and closes it, you app will take between 15 to 20M

Belive me I have coded my application very carefully and when I talk about
refrence couting I don't mean COM, I mean I make sure there are zero
refrences for an object, so the GC can collect it.

"Scott M." <s-***@nospam.nosp am> wrote in message
news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
Well, from your comments it sounds like you might not fully understand how
memory is managed in .NET. .NET does NOT use reference counters like COM
applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code, you get poor performance. I'd start by examine your code and make sure you are calling Dispose on any object that uses unmanaged resources, call Close on
any object that is opened, manage any multi-threading you may be doing with a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be
using, set the ASPCompat property of ASP.NET pages to True when using COM
objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing in that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
I know everything about reference counting and making sure you don't have
large objects lying around. I have also profiled my app with multiple
tools.
I know about the fact GC collects memory but not necessary give it back to the OS.

It seems that .NET win app will only return memory to the OS when the OS
is
asking for it. But!!! When the OS is asking for it is usually too late,
tons
of swapping and slow performance.

I just don't get it, how can .NET a superior technology is eating so much RAM? I see that some people force their app to minimize or trim their
workspace just to free the memory - that is a bad idea. Other people
unload
a application domain to save memory... a little better but still lots of
work just to get some memory back to the OS.

Some people tell me it is the price to pay for a runtime. Sorry, I have
used
other runtimes for windows applications and they don't eat so much memory. For the love of god, AcuCobol runtime does not take so much RAM (not that I
want to code in COBOL now)

At the end, it seems it is like running an OS within an OS. I am
frustrated
that a stupid windows application can take 20M for doing nothing, and if
you
have an app that does a little more stuff, it can take 40M and you have to worry about each Dispose and reference so it will not jump to 100M.

and I am not alone with this problem....

http://www.dotnet247.com/247referenc.../14/73033.aspx




Aug 14 '05 #4
> Thre is no code!

Just write a win form app that connects to Access or SQL server, open the
connection and closes it, you app will take between 15 to 20M
Well, I'd call what you've stated above some code. Let's see exactly what
you wrote because if I write code that does what you suggest, it doesn't
come anywhere near the memory usage you are experiencing.
Belive me I have coded my application very carefully and when I talk about
refrence couting I don't mean COM, I mean I make sure there are zero
refrences for an object, so the GC can collect it.
Although you say that I should "believe you" that you've coded carefully,
you continue to give us no examples of what you are doing. And, since I've
used .NET since early betas (nearly 4 years now) and have not experienced
what you are experiencing but have seen what you describe over and over
again with code that is not written properly, I'm going to have a hard time
just "beliving" that you are doing everything correctly.

It almost sounds like you don't want to solve your problem and would just
prefer to complain about .NET. Let's see your code!

"Scott M." <s-***@nospam.nosp am> wrote in message
news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
Well, from your comments it sounds like you might not fully understand
how
memory is managed in .NET. .NET does NOT use reference counters like COM
applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code,

you
get poor performance. I'd start by examine your code and make sure you

are
calling Dispose on any object that uses unmanaged resources, call Close
on
any object that is opened, manage any multi-threading you may be doing

with
a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be
using, set the ASPCompat property of ASP.NET pages to True when using COM
objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing

in
that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able
to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
>I know everything about reference counting and making sure you don't
>have
> large objects lying around. I have also profiled my app with multiple
> tools.
> I know about the fact GC collects memory but not necessary give it back to > the OS.
>
>
>
> It seems that .NET win app will only return memory to the OS when the
> OS
> is
> asking for it. But!!! When the OS is asking for it is usually too late,
> tons
> of swapping and slow performance.
>
>
>
> I just don't get it, how can .NET a superior technology is eating so much > RAM? I see that some people force their app to minimize or trim their
> workspace just to free the memory - that is a bad idea. Other people
> unload
> a application domain to save memory... a little better but still lots
> of
> work just to get some memory back to the OS.
>
>
>
> Some people tell me it is the price to pay for a runtime. Sorry, I have
> used
> other runtimes for windows applications and they don't eat so much memory. > For the love of god, AcuCobol runtime does not take so much RAM (not that > I
> want to code in COBOL now)
>
>
>
> At the end, it seems it is like running an OS within an OS. I am
> frustrated
> that a stupid windows application can take 20M for doing nothing, and
> if
> you
> have an app that does a little more stuff, it can take 40M and you have to > worry about each Dispose and reference so it will not jump to 100M.
>
>
>
> and I am not alone with this problem....
>
>
>
> http://www.dotnet247.com/247referenc.../14/73033.aspx >
>
>
>
>
>
>
>
>



Aug 14 '05 #5
What's also interesting is that in the article you provide, your experience
seems to fall into the one described in the first paragraph, which starts
off: "Newbies to .NET often criticize its memory management and its garbage
collector,
but the criticisms are typically based on a lack of understanding and
nothing more."
The rest of the article doesn't seem to apply to what you have experieced.
"Mike P" <m_******@hotma il.com> wrote in message
news:Xt******** *******@news20. bellglobal.com. ..
Thre is no code!

Just write a win form app that connects to Access or SQL server, open the
connection and closes it, you app will take between 15 to 20M

Belive me I have coded my application very carefully and when I talk about
refrence couting I don't mean COM, I mean I make sure there are zero
refrences for an object, so the GC can collect it.

"Scott M." <s-***@nospam.nosp am> wrote in message
news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
Well, from your comments it sounds like you might not fully understand
how
memory is managed in .NET. .NET does NOT use reference counters like COM
applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code,

you
get poor performance. I'd start by examine your code and make sure you

are
calling Dispose on any object that uses unmanaged resources, call Close
on
any object that is opened, manage any multi-threading you may be doing

with
a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be
using, set the ASPCompat property of ASP.NET pages to True when using COM
objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing

in
that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able
to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
>I know everything about reference counting and making sure you don't
>have
> large objects lying around. I have also profiled my app with multiple
> tools.
> I know about the fact GC collects memory but not necessary give it back to > the OS.
>
>
>
> It seems that .NET win app will only return memory to the OS when the
> OS
> is
> asking for it. But!!! When the OS is asking for it is usually too late,
> tons
> of swapping and slow performance.
>
>
>
> I just don't get it, how can .NET a superior technology is eating so much > RAM? I see that some people force their app to minimize or trim their
> workspace just to free the memory - that is a bad idea. Other people
> unload
> a application domain to save memory... a little better but still lots
> of
> work just to get some memory back to the OS.
>
>
>
> Some people tell me it is the price to pay for a runtime. Sorry, I have
> used
> other runtimes for windows applications and they don't eat so much memory. > For the love of god, AcuCobol runtime does not take so much RAM (not that > I
> want to code in COBOL now)
>
>
>
> At the end, it seems it is like running an OS within an OS. I am
> frustrated
> that a stupid windows application can take 20M for doing nothing, and
> if
> you
> have an app that does a little more stuff, it can take 40M and you have to > worry about each Dispose and reference so it will not jump to 100M.
>
>
>
> and I am not alone with this problem....
>
>
>
> http://www.dotnet247.com/247referenc.../14/73033.aspx >
>
>
>
>
>
>
>
>



Aug 14 '05 #6
You are right, I am going to provide you the code, most of it is generated
by Visual Stuido, all this program does is open an Oledbconnection and
closes that connection. This program takes 20M of RAM on my machine.

I know, most of this RAM is used by .NET memory managemnt and pooling
objects, I still believe that it is too high. If you minimize the program
and maximize it again, the working size is trimmed to about 4M.

using System;

using System.Drawing;

using System.Collecti ons;

using System.Componen tModel;

using System.Windows. Forms;

using System.Data;

namespace WindowsApplicat ion4

{

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows. Forms.Form

{

private System.Data.Ole Db.OleDbDataAda pter oleDbDataAdapte r1;

private System.Data.Ole Db.OleDbCommand oleDbSelectComm and1;

private System.Data.Ole Db.OleDbCommand oleDbInsertComm and1;

private System.Data.Ole Db.OleDbCommand oleDbUpdateComm and1;

private System.Data.Ole Db.OleDbCommand oleDbDeleteComm and1;

private System.Data.Ole Db.OleDbConnect ion oleDbConnection 1;

private System.Windows. Forms.Button button1;

/// <summary>

/// Required designer variable.

/// </summary>

private System.Componen tModel.Containe r components = null;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeCompo nent();

//

// TODO: Add any constructor code after InitializeCompo nent call

//

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Disp ose();

}

}

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeCompo nent()

{

this.oleDbDataA dapter1 = new System.Data.Ole Db.OleDbDataAda pter();

this.oleDbSelec tCommand1 = new System.Data.Ole Db.OleDbCommand ();

this.oleDbInser tCommand1 = new System.Data.Ole Db.OleDbCommand ();

this.oleDbUpdat eCommand1 = new System.Data.Ole Db.OleDbCommand ();

this.oleDbDelet eCommand1 = new System.Data.Ole Db.OleDbCommand ();

this.oleDbConne ction1 = new System.Data.Ole Db.OleDbConnect ion();

this.button1 = new System.Windows. Forms.Button();

this.SuspendLay out();

//

// oleDbDataAdapte r1

//

this.oleDbDataA dapter1.DeleteC ommand = this.oleDbDelet eCommand1;

this.oleDbDataA dapter1.InsertC ommand = this.oleDbInser tCommand1;

this.oleDbDataA dapter1.SelectC ommand = this.oleDbSelec tCommand1;

this.oleDbDataA dapter1.TableMa ppings.AddRange (new
System.Data.Com mon.DataTableMa pping[] {

new System.Data.Com mon.DataTableMa pping("Table", "Generic", new
System.Data.Com mon.DataColumnM apping[] {

new System.Data.Com mon.DataColumnM apping("Generic ", "Generic"),

new System.Data.Com mon.DataColumnM apping("ID", "ID"),

new System.Data.Com mon.DataColumnM apping("NTE", "NTE"),

new System.Data.Com mon.DataColumnM apping("PinNum" , "PinNum"),

new System.Data.Com mon.DataColumnM apping("Stock", "Stock")})} );

this.oleDbDataA dapter1.UpdateC ommand = this.oleDbUpdat eCommand1;

//

// oleDbSelectComm and1

//

this.oleDbSelec tCommand1.Comma ndText = "SELECT Generic, ID, NTE, PinNum,
Stock FROM Generic";

this.oleDbSelec tCommand1.Conne ction = this.oleDbConne ction1;

//

// oleDbInsertComm and1

//

this.oleDbInser tCommand1.Comma ndText = "INSERT INTO Generic(Generic , NTE,
PinNum, Stock) VALUES (?, ?, ?, ?)";

this.oleDbInser tCommand1.Conne ction = this.oleDbConne ction1;

this.oleDbInser tCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Generic",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "Generic")) ;

this.oleDbInser tCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("NTE",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "NTE"));

this.oleDbInser tCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("PinNum",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "PinNum"));

this.oleDbInser tCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Stock",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "Stock"));

//

// oleDbUpdateComm and1

//

this.oleDbUpdat eCommand1.Comma ndText = @"UPDATE Generic SET Generic = ?, NTE
= ?, PinNum = ?, Stock = ? WHERE (ID = ?) AND (Generic = ? OR ? IS NULL AND
Generic IS NULL) AND (NTE = ? OR ? IS NULL AND NTE IS NULL) AND (PinNum = ?
OR ? IS NULL AND PinNum IS NULL) AND (Stock = ? OR ? IS NULL AND Stock IS
NULL)";

this.oleDbUpdat eCommand1.Conne ction = this.oleDbConne ction1;

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Generic",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "Generic")) ;

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("NTE",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "NTE"));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("PinNum",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "PinNum"));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Stock",
System.Data.Ole Db.OleDbType.Va rWChar, 50, "Stock"));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_ID ",
System.Data.Ole Db.OleDbType.In teger, 0,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "ID", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Ge neric",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Generic", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Ge neric1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Generic", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_NT E",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "NTE", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_NT E1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "NTE", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Pi nNum",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "PinNum", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Pi nNum1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "PinNum", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_St ock",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Stock", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbUpdat eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_St ock1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Stock", System.Data.Dat aRowVersion.Ori ginal, null));

//

// oleDbDeleteComm and1

//

this.oleDbDelet eCommand1.Comma ndText = "DELETE FROM Generic WHERE (ID = ?)
AND (Generic = ? OR ? IS NULL AND Generic IS N" +

"ULL) AND (NTE = ? OR ? IS NULL AND NTE IS NULL) AND (PinNum = ? OR ? IS
NULL AND" +

" PinNum IS NULL) AND (Stock = ? OR ? IS NULL AND Stock IS NULL)";

this.oleDbDelet eCommand1.Conne ction = this.oleDbConne ction1;

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_ID ",
System.Data.Ole Db.OleDbType.In teger, 0,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "ID", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Ge neric",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Generic", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Ge neric1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Generic", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_NT E",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "NTE", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_NT E1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "NTE", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Pi nNum",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "PinNum", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_Pi nNum1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "PinNum", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_St ock",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Stock", System.Data.Dat aRowVersion.Ori ginal, null));

this.oleDbDelet eCommand1.Param eters.Add(new
System.Data.Ole Db.OleDbParamet er("Original_St ock1",
System.Data.Ole Db.OleDbType.Va rWChar, 50,
System.Data.Par ameterDirection .Input, false, ((System.Byte)( 0)),
((System.Byte)( 0)), "Stock", System.Data.Dat aRowVersion.Ori ginal, null));

//

// oleDbConnection 1

//

this.oleDbConne ction1.Connecti onString = @"Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Database Password=;Data
Source=""C:\Dat abase\Applicati onCore.mdb"";Pa ssword=;Jet OLEDB:Engine
Type=5;Jet OLEDB:Global Bulk
Transactions=1; Provider=""Micr osoft.Jet.OLEDB .4.0"";Jet OLEDB:System
database=;Jet OLEDB:SFP=False ;Extended Properties=;Mod e=Share Deny None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False; Jet
OLEDB:Don't Copy Locale on Compact=False;J et OLEDB:Compact Without Replica
Repair=False;Us er ID=Admin;Jet OLEDB:Encrypt Database=False" ;

//

// button1

//

this.button1.Lo cation = new System.Drawing. Point(96, 48);

this.button1.Na me = "button1";

this.button1.Ta bIndex = 0;

this.button1.Te xt = "button1";

this.button1.Cl ick += new System.EventHan dler(this.butto n1_Click);

//

// Form1

//

this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);

this.ClientSize = new System.Drawing. Size(292, 266);

this.Controls.A dd(this.button1 );

this.Name = "Form1";

this.Text = "Form1";

this.ResumeLayo ut(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.Run (new Form1());

}

private void oleDbDataAdapte r1_RowUpdated(o bject sender,
System.Data.Ole Db.OleDbRowUpda tedEventArgs e)

{
}

private void button1_Click(o bject sender, System.EventArg s e)

{

oleDbConnection 1.Open();

oleDbConnection 1.Close();

}

}

}
"Scott M." <s-***@nospam.nosp am> wrote in message
news:eo******** ******@TK2MSFTN GP14.phx.gbl...
Thre is no code!

Just write a win form app that connects to Access or SQL server, open the connection and closes it, you app will take between 15 to 20M
Well, I'd call what you've stated above some code. Let's see exactly what
you wrote because if I write code that does what you suggest, it doesn't
come anywhere near the memory usage you are experiencing.
Belive me I have coded my application very carefully and when I talk about refrence couting I don't mean COM, I mean I make sure there are zero
refrences for an object, so the GC can collect it.


Although you say that I should "believe you" that you've coded carefully,
you continue to give us no examples of what you are doing. And, since

I've used .NET since early betas (nearly 4 years now) and have not experienced
what you are experiencing but have seen what you describe over and over
again with code that is not written properly, I'm going to have a hard time just "beliving" that you are doing everything correctly.

It almost sounds like you don't want to solve your problem and would just
prefer to complain about .NET. Let's see your code!

"Scott M." <s-***@nospam.nosp am> wrote in message
news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
Well, from your comments it sounds like you might not fully understand
how
memory is managed in .NET. .NET does NOT use reference counters like COM applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code,

you
get poor performance. I'd start by examine your code and make sure you

are
calling Dispose on any object that uses unmanaged resources, call Close
on
any object that is opened, manage any multi-threading you may be doing

with
a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be using, set the ASPCompat property of ASP.NET pages to True when using COM objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing
in
that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able
to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
>I know everything about reference counting and making sure you don't
>have
> large objects lying around. I have also profiled my app with multiple
> tools.
> I know about the fact GC collects memory but not necessary give it
back to
> the OS.
>
>
>
> It seems that .NET win app will only return memory to the OS when the
> OS
> is
> asking for it. But!!! When the OS is asking for it is usually too
late, > tons
> of swapping and slow performance.
>
>
>
> I just don't get it, how can .NET a superior technology is eating so

much
> RAM? I see that some people force their app to minimize or trim their
> workspace just to free the memory - that is a bad idea. Other people
> unload
> a application domain to save memory... a little better but still lots
> of
> work just to get some memory back to the OS.
>
>
>
> Some people tell me it is the price to pay for a runtime. Sorry, I have > used
> other runtimes for windows applications and they don't eat so much

memory.
> For the love of god, AcuCobol runtime does not take so much RAM (not

that
> I
> want to code in COBOL now)
>
>
>
> At the end, it seems it is like running an OS within an OS. I am
> frustrated
> that a stupid windows application can take 20M for doing nothing, and
> if
> you
> have an app that does a little more stuff, it can take 40M and you have to
> worry about each Dispose and reference so it will not jump to 100M.
>
>
>
> and I am not alone with this problem....
>
>
>
>

http://www.dotnet247.com/247referenc.../14/73033.aspx >
>
>
>
>
>
>
>
>



Aug 14 '05 #7
You don't understand me at all. I love C# and .NET, in fact I will probably
work in this environment in many years to come.

My frustration is that memory management in .NET is not well documented. I
find that the GC is well documented, but it is clear that what the GC is
freeing goes back to the "manage heap" and not the OS.

I am not criticising the GC at all, I think it does a good job, I am
criticising the lack of documentation or functionality when it comes to
Process memory in regards the OS (not the runtime or the managed heap).

I want to know when memory is returned to the OS, I find that when the
system needs the memory it is simply "too late".

Maybe, this is not even a .NET issue and should be regarded as an OS issue.
"Scott M." <s-***@nospam.nosp am> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
What's also interesting is that in the article you provide, your experience seems to fall into the one described in the first paragraph, which starts
off: "Newbies to .NET often criticize its memory management and its garbage collector,
but the criticisms are typically based on a lack of understanding and
nothing more."
The rest of the article doesn't seem to apply to what you have experieced.
"Mike P" <m_******@hotma il.com> wrote in message
news:Xt******** *******@news20. bellglobal.com. ..
Thre is no code!

Just write a win form app that connects to Access or SQL server, open the connection and closes it, you app will take between 15 to 20M

Belive me I have coded my application very carefully and when I talk about refrence couting I don't mean COM, I mean I make sure there are zero
refrences for an object, so the GC can collect it.

"Scott M." <s-***@nospam.nosp am> wrote in message
news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
Well, from your comments it sounds like you might not fully understand
how
memory is managed in .NET. .NET does NOT use reference counters like COM applications do.

Ultimately, it's not the Framework that is tying up memory, it is your
application. In any programming environment, if you write sloppy code,

you
get poor performance. I'd start by examine your code and make sure you

are
calling Dispose on any object that uses unmanaged resources, call Close
on
any object that is opened, manage any multi-threading you may be doing

with
a watchful eye, use the Marshall.Releas eComObject class to allow the
Framework to release its references to any and ALL COM objects you may be using, set the ASPCompat property of ASP.NET pages to True when using COM objects in ASP.NET pages, etc. etc.

In short, before you beat up on the platform, examine what you are doing
in
that platform. You haven't told us anything about the code you are
attempting to run. If you do, we can get a feel for how we may be able
to
help or point you in the right learning direction.
"Mike P" <m_******@hotma il.com> wrote in message
news:29******** ************@ne ws20.bellglobal .com...
>I know everything about reference counting and making sure you don't
>have
> large objects lying around. I have also profiled my app with multiple
> tools.
> I know about the fact GC collects memory but not necessary give it
back to
> the OS.
>
>
>
> It seems that .NET win app will only return memory to the OS when the
> OS
> is
> asking for it. But!!! When the OS is asking for it is usually too
late, > tons
> of swapping and slow performance.
>
>
>
> I just don't get it, how can .NET a superior technology is eating so

much
> RAM? I see that some people force their app to minimize or trim their
> workspace just to free the memory - that is a bad idea. Other people
> unload
> a application domain to save memory... a little better but still lots
> of
> work just to get some memory back to the OS.
>
>
>
> Some people tell me it is the price to pay for a runtime. Sorry, I have > used
> other runtimes for windows applications and they don't eat so much

memory.
> For the love of god, AcuCobol runtime does not take so much RAM (not

that
> I
> want to code in COBOL now)
>
>
>
> At the end, it seems it is like running an OS within an OS. I am
> frustrated
> that a stupid windows application can take 20M for doing nothing, and
> if
> you
> have an app that does a little more stuff, it can take 40M and you have to
> worry about each Dispose and reference so it will not jump to 100M.
>
>
>
> and I am not alone with this problem....
>
>
>
>

http://www.dotnet247.com/247referenc.../14/73033.aspx >
>
>
>
>
>
>
>
>



Aug 14 '05 #8
Inline

Willy.

"Mike P" <m_******@hotma il.com> wrote in message
news:bf******** **********@news 20.bellglobal.c om...
You don't understand me at all. I love C# and .NET, in fact I will
probably
work in this environment in many years to come.

My frustration is that memory management in .NET is not well documented.
There is no such thing as Memory management in .NET, Memory management is a
task of the OS, the OS knows nothing about .NET and there is no such thing
like a .NET process, so it's not documented as part of .NET. (see later).
find that the GC is well documented, but it is clear that what the GC is
freeing goes back to the "manage heap" and not the OS.
Basically, that's the task of the GC, manage the object allocation and
de-allocation from the GC heap, no more no less. A .NET process is just
another windows process, it has private heaps allocated from the process
heap, and one of them is called the GC heap, but basically it's in no way
different from say the (ref. counting GC collected heap of a VB6 process
(yes VB6 has also a GC). Oh, I hear you say 'but it's size is much larger',
sure it is, so is the size taken by Windows XP the OS and Explorer and do
you know why? because memory size higly relates to features like growing
disk size, ever wondered why explorer takes > 40 MB when you open and start
navigating a 200GB drive?
The same is true for .NET, it comes at a price, the price is that the memory
footprint is somewhat (5-6MB) higher than a VB6 or C++ or any other "native"
application, but heck this is only the footprint anything else doen't take
much more memory than their native counterparts, the difference is that
no-one ever cared to look at Taskman to watch it's "memory consumption",
but now they know that there is a GC that is playing with 'their' toys, they
spend more time looking at 'Mem used' than trying to understand the features
of the languages, the framework library and the richness of the API's, what
can be done with it and what can't or shouldn't be done with it.


I am not criticising the GC at all, I think it does a good job, I am
criticising the lack of documentation or functionality when it comes to
Process memory in regards the OS (not the runtime or the managed heap).
Process memory allocation and memory management for Windows is well
documented in the Platform SDK documentation. There are a number of good
books arround like Mark Russinovich and Dave Solomon's "Windows Internals"
who tell you more than you ever need to know about it, there are a number of
real good tools arround to help you understand what memory consumption is
all about, but again, only if you realy care, it's not that important. Only,
if you start arguing about it and draw conclusions, be prepared to know what
you are talking about, know how you measure things yourself, don't base your
findings alone on what you read on the internet.



I want to know when memory is returned to the OS, I find that when the
system needs the memory it is simply "too late".
What you find is not important, it's the OS memory manager who knows better
than anyone else when memory should be returned and more importantly what
and who's memory should be returned.
Those who are trying to be smart and call GC.Collect and call the Win32 API
to trim the Working Set don't have an idea how they are disturbing the GC
and the OS Memory manager by doing this, all they see is the "Used memory"
going down in Taskman and they are happy and they can (thank God freedom of
speech) blog about their findings and tell the world how smart they are and
how dumb the MSFT developpers are.



Maybe, this is not even a .NET issue and should be regarded as an OS
issue.

Well it's none of both, it's simply not an issue, really.
I don't mean .NET is perfect, it's NOT perfect at all, there are other, much
more important issues to be solved, the upcoming version 2.0, takes care of
a lot of them, but as far as memory goes it reduces the base working set by
a fair amounth , but at the same time new features (requested by the
community) are added, which take more memory so the net result is about the
same.

Willy.


"Scott M." <s-***@nospam.nosp am> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
What's also interesting is that in the article you provide, your

experience
seems to fall into the one described in the first paragraph, which starts
off: "Newbies to .NET often criticize its memory management and its

garbage
collector,
but the criticisms are typically based on a lack of understanding and
nothing more."
The rest of the article doesn't seem to apply to what you have
experieced.
"Mike P" <m_******@hotma il.com> wrote in message
news:Xt******** *******@news20. bellglobal.com. ..
> Thre is no code!
>
> Just write a win form app that connects to Access or SQL server, open the > connection and closes it, you app will take between 15 to 20M
>
> Belive me I have coded my application very carefully and when I talk about > refrence couting I don't mean COM, I mean I make sure there are zero
> refrences for an object, so the GC can collect it.
>
> "Scott M." <s-***@nospam.nosp am> wrote in message
> news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
>> Well, from your comments it sounds like you might not fully understand
>> how
>> memory is managed in .NET. .NET does NOT use reference counters like COM >> applications do.
>>
>> Ultimately, it's not the Framework that is tying up memory, it is your
>> application. In any programming environment, if you write sloppy
>> code,
> you
>> get poor performance. I'd start by examine your code and make sure
>> you
> are
>> calling Dispose on any object that uses unmanaged resources, call
>> Close
>> on
>> any object that is opened, manage any multi-threading you may be doing
> with
>> a watchful eye, use the Marshall.Releas eComObject class to allow the
>> Framework to release its references to any and ALL COM objects you may be >> using, set the ASPCompat property of ASP.NET pages to True when using COM >> objects in ASP.NET pages, etc. etc.
>>
>> In short, before you beat up on the platform, examine what you are doing > in
>> that platform. You haven't told us anything about the code you are
>> attempting to run. If you do, we can get a feel for how we may be
>> able
>> to
>> help or point you in the right learning direction.
>>
>>
>> "Mike P" <m_******@hotma il.com> wrote in message
>> news:29******** ************@ne ws20.bellglobal .com...
>> >I know everything about reference counting and making sure you don't
>> >have
>> > large objects lying around. I have also profiled my app with
>> > multiple
>> > tools.
>> > I know about the fact GC collects memory but not necessary give it back > to
>> > the OS.
>> >
>> >
>> >
>> > It seems that .NET win app will only return memory to the OS when
>> > the
>> > OS
>> > is
>> > asking for it. But!!! When the OS is asking for it is usually too late, >> > tons
>> > of swapping and slow performance.
>> >
>> >
>> >
>> > I just don't get it, how can .NET a superior technology is eating so
> much
>> > RAM? I see that some people force their app to minimize or trim
>> > their
>> > workspace just to free the memory - that is a bad idea. Other people
>> > unload
>> > a application domain to save memory... a little better but still
>> > lots
>> > of
>> > work just to get some memory back to the OS.
>> >
>> >
>> >
>> > Some people tell me it is the price to pay for a runtime. Sorry, I have >> > used
>> > other runtimes for windows applications and they don't eat so much
> memory.
>> > For the love of god, AcuCobol runtime does not take so much RAM (not
> that
>> > I
>> > want to code in COBOL now)
>> >
>> >
>> >
>> > At the end, it seems it is like running an OS within an OS. I am
>> > frustrated
>> > that a stupid windows application can take 20M for doing nothing,
>> > and
>> > if
>> > you
>> > have an app that does a little more stuff, it can take 40M and you have > to
>> > worry about each Dispose and reference so it will not jump to 100M.
>> >
>> >
>> >
>> > and I am not alone with this problem....
>> >
>> >
>> >
>> >
> http://www.dotnet247.com/247referenc.../14/73033.aspx >> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>



Aug 14 '05 #9
Well said Willy. And, by the way, much of what you've said here is plainly
stated in the article the OP himself included.
"Willy Denoyette [MVP]" <wi************ *@telenet.be> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Inline

Willy.

"Mike P" <m_******@hotma il.com> wrote in message
news:bf******** **********@news 20.bellglobal.c om...
You don't understand me at all. I love C# and .NET, in fact I will
probably
work in this environment in many years to come.

My frustration is that memory management in .NET is not well documented.


There is no such thing as Memory management in .NET, Memory management is
a task of the OS, the OS knows nothing about .NET and there is no such
thing like a .NET process, so it's not documented as part of .NET. (see
later).
find that the GC is well documented, but it is clear that what the GC is
freeing goes back to the "manage heap" and not the OS.

Basically, that's the task of the GC, manage the object allocation and
de-allocation from the GC heap, no more no less. A .NET process is just
another windows process, it has private heaps allocated from the process
heap, and one of them is called the GC heap, but basically it's in no way
different from say the (ref. counting GC collected heap of a VB6 process
(yes VB6 has also a GC). Oh, I hear you say 'but it's size is much
larger', sure it is, so is the size taken by Windows XP the OS and
Explorer and do you know why? because memory size higly relates to
features like growing disk size, ever wondered why explorer takes > 40 MB
when you open and start navigating a 200GB drive?
The same is true for .NET, it comes at a price, the price is that the
memory footprint is somewhat (5-6MB) higher than a VB6 or C++ or any other
"native" application, but heck this is only the footprint anything else
doen't take much more memory than their native counterparts, the
difference is that no-one ever cared to look at Taskman to watch it's
"memory consumption", but now they know that there is a GC that is playing
with 'their' toys, they spend more time looking at 'Mem used' than trying
to understand the features of the languages, the framework library and the
richness of the API's, what can be done with it and what can't or
shouldn't be done with it.


I am not criticising the GC at all, I think it does a good job, I am
criticising the lack of documentation or functionality when it comes to
Process memory in regards the OS (not the runtime or the managed heap).

Process memory allocation and memory management for Windows is well
documented in the Platform SDK documentation. There are a number of good
books arround like Mark Russinovich and Dave Solomon's "Windows Internals"
who tell you more than you ever need to know about it, there are a number
of real good tools arround to help you understand what memory consumption
is all about, but again, only if you realy care, it's not that important.
Only, if you start arguing about it and draw conclusions, be prepared to
know what you are talking about, know how you measure things yourself,
don't base your findings alone on what you read on the internet.



I want to know when memory is returned to the OS, I find that when the
system needs the memory it is simply "too late".

What you find is not important, it's the OS memory manager who knows
better than anyone else when memory should be returned and more
importantly what and who's memory should be returned.
Those who are trying to be smart and call GC.Collect and call the Win32
API to trim the Working Set don't have an idea how they are disturbing the
GC and the OS Memory manager by doing this, all they see is the "Used
memory" going down in Taskman and they are happy and they can (thank God
freedom of speech) blog about their findings and tell the world how smart
they are and how dumb the MSFT developpers are.



Maybe, this is not even a .NET issue and should be regarded as an OS
issue.


Well it's none of both, it's simply not an issue, really.
I don't mean .NET is perfect, it's NOT perfect at all, there are other,
much more important issues to be solved, the upcoming version 2.0, takes
care of a lot of them, but as far as memory goes it reduces the base
working set by a fair amounth , but at the same time new features
(requested by the community) are added, which take more memory so the net
result is about the same.

Willy.


"Scott M." <s-***@nospam.nosp am> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
What's also interesting is that in the article you provide, your

experience
seems to fall into the one described in the first paragraph, which
starts
off: "Newbies to .NET often criticize its memory management and its

garbage
collector,
but the criticisms are typically based on a lack of understanding and
nothing more."
The rest of the article doesn't seem to apply to what you have
experieced.
"Mike P" <m_******@hotma il.com> wrote in message
news:Xt******** *******@news20. bellglobal.com. ..
> Thre is no code!
>
> Just write a win form app that connects to Access or SQL server, open

the
> connection and closes it, you app will take between 15 to 20M
>
> Belive me I have coded my application very carefully and when I talk

about
> refrence couting I don't mean COM, I mean I make sure there are zero
> refrences for an object, so the GC can collect it.
>
> "Scott M." <s-***@nospam.nosp am> wrote in message
> news:um******** *******@TK2MSFT NGP12.phx.gbl.. .
>> Well, from your comments it sounds like you might not fully
>> understand
>> how
>> memory is managed in .NET. .NET does NOT use reference counters like

COM
>> applications do.
>>
>> Ultimately, it's not the Framework that is tying up memory, it is
>> your
>> application. In any programming environment, if you write sloppy
>> code,
> you
>> get poor performance. I'd start by examine your code and make sure
>> you
> are
>> calling Dispose on any object that uses unmanaged resources, call
>> Close
>> on
>> any object that is opened, manage any multi-threading you may be
>> doing
> with
>> a watchful eye, use the Marshall.Releas eComObject class to allow the
>> Framework to release its references to any and ALL COM objects you
>> may

be
>> using, set the ASPCompat property of ASP.NET pages to True when using

COM
>> objects in ASP.NET pages, etc. etc.
>>
>> In short, before you beat up on the platform, examine what you are

doing
> in
>> that platform. You haven't told us anything about the code you are
>> attempting to run. If you do, we can get a feel for how we may be
>> able
>> to
>> help or point you in the right learning direction.
>>
>>
>> "Mike P" <m_******@hotma il.com> wrote in message
>> news:29******** ************@ne ws20.bellglobal .com...
>> >I know everything about reference counting and making sure you don't
>> >have
>> > large objects lying around. I have also profiled my app with
>> > multiple
>> > tools.
>> > I know about the fact GC collects memory but not necessary give it

back
> to
>> > the OS.
>> >
>> >
>> >
>> > It seems that .NET win app will only return memory to the OS when
>> > the
>> > OS
>> > is
>> > asking for it. But!!! When the OS is asking for it is usually too

late,
>> > tons
>> > of swapping and slow performance.
>> >
>> >
>> >
>> > I just don't get it, how can .NET a superior technology is eating
>> > so
> much
>> > RAM? I see that some people force their app to minimize or trim
>> > their
>> > workspace just to free the memory - that is a bad idea. Other
>> > people
>> > unload
>> > a application domain to save memory... a little better but still
>> > lots
>> > of
>> > work just to get some memory back to the OS.
>> >
>> >
>> >
>> > Some people tell me it is the price to pay for a runtime. Sorry, I

have
>> > used
>> > other runtimes for windows applications and they don't eat so much
> memory.
>> > For the love of god, AcuCobol runtime does not take so much RAM
>> > (not
> that
>> > I
>> > want to code in COBOL now)
>> >
>> >
>> >
>> > At the end, it seems it is like running an OS within an OS. I am
>> > frustrated
>> > that a stupid windows application can take 20M for doing nothing,
>> > and
>> > if
>> > you
>> > have an app that does a little more stuff, it can take 40M and you

have
> to
>> > worry about each Dispose and reference so it will not jump to 100M.
>> >
>> >
>> >
>> > and I am not alone with this problem....
>> >
>> >
>> >
>> >
>

http://www.dotnet247.com/247referenc.../14/73033.aspx
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>



Aug 15 '05 #10

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

Similar topics

2
3321
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...
5
2751
by: Jarek | last post by:
Hi all! I'm optimizing my C++ multi-threaded application (linux). My application consumes huge amout of memory from unknown reason. There are no memory leaks, or other allocation bugs, application works well, but on startup it has about 200mb (VmSize). How can I investigate what function/class/other takes so much memory ? I tried to verify...
18
1309
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but not necessary give it back to the OS. It seems that .NET win app will only return memory to the OS when the OS is asking for it. But!!! When...
6
4642
by: Max Ivanov | last post by:
I'm playing with pyprocessing module and found that it eats lot's of memory. I've made small test case to show it. I pass ~45mb of data to worker processes and than get it back slightly modified. At any time in main process there are shouldn't be no more than two copies of data (one original data and one result). I run it on 8-core server and...
0
7504
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
7435
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
7694
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. ...
1
7461
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...
0
7792
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...
0
6026
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...
0
3491
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...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.