Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / November 2005

Tip: Looking for answers? Try searching our database.

CLR Reserved Bytes Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arka - 26 Oct 2005 11:46 GMT
Hi,

We have memory problems with one of our ASP.Net application.

While analysing the process memory I found that two performance
counters were displaying interesting values:

#Total Committed Bytes: 145'000'000
#Total Reserved Bytes : 647'000'000

I understand that "Total Reserved Bytes" should be higher than "Total
Committed Bytes" but there are quite a lot reserved bytes !

Our problem is that when our app needs more memory we reach the 1.2GB
limit very fast :(

Is there a way to free some of the reserved bytes ?

Thanks,

Arkam
Willy Denoyette [MVP] - 30 Oct 2005 12:27 GMT
The reserved bytes is not the problem, the commited bytes is somewhat more
important but not that much, what realy counts is the working set and
private byte counters.
How to reduce memory usage? well, that's up to you, use a memory profiler
and watch your allocation pattern, make sure you don't waste memory by
holding large managed objects in memory for a too long period of time and
make sure you dispose of expensive objects (holding native resources) when
done with them.

Willy.

> Hi,
>
[quoted text clipped - 17 lines]
>
> Arkam
Arka - 31 Oct 2005 15:46 GMT
Well, I do not think that "The reserved bytes is not the problem, the
commited bytes is somewhat more important but not that much" !

One app does take 647MB RAM although it only needs 145MB RAM !

What if we had 4 such apps ???

We would need 4GB RAM to only use 600MB !

The ASP.Net Process should release this memory for other programs and
not hold it !

We cannot reduce memory usage because it depends on the last on our
server!

The problem is asp.net not releasing the memory when the last does
drop!

Any idea ?

Arkam

Willy Denoyette [MVP] a écrit :

> The reserved bytes is not the problem, the commited bytes is somewhat more
> important but not that much, what realy counts is the working set and
[quoted text clipped - 28 lines]
> >
> > Arkam
Willy Denoyette [MVP] - 31 Oct 2005 20:07 GMT
You wont run 4 asp.net proceses don't you? but even if you did, the Windows
OS uses a VM management system, so it does not mean that all memory
committed for all processes must be and shall be in RAM memory.
Anyway, what's important is, when talking about the managed heap is the
space taken in every generation.
Threfore you should look at the Gen0, 1, 2 and largeheap counters, they are
far more important than the reserved bytes, because this doesn't represent
anything physical. It's possible that during application run the heap did
grow up to 647 MB and tha now only 145 MB remains committed, that means 500
MB has returned to the system.
Now if your application consumes ( at some point in time) that much memory
(647MB) you have to inspect your allocation pattern, check what objects you
are allocating and what there type is (Large objects?).

Willy.

Well, I do not think that "The reserved bytes is not the problem, the
commited bytes is somewhat more important but not that much" !

One app does take 647MB RAM although it only needs 145MB RAM !

What if we had 4 such apps ???

We would need 4GB RAM to only use 600MB !

The ASP.Net Process should release this memory for other programs and
not hold it !

We cannot reduce memory usage because it depends on the last on our
server!

The problem is asp.net not releasing the memory when the last does
drop!

Any idea ?

Arkam

Willy Denoyette [MVP] a écrit :

> The reserved bytes is not the problem, the commited bytes is somewhat more
> important but not that much, what realy counts is the working set and
[quoted text clipped - 28 lines]
> >
> > Arkam
Arka - 02 Nov 2005 12:00 GMT
We are running many w3wp process (we use AppPools).

What you describe is exactly what happens!

Our application needs sometimes a lot of memory for short times.
But this part:
"that means 500 MB has returned to the system."
is wrong because the system cannot use these 500MB anymore because they
are "reserved" for our w3wp process !

What can we do ?

Arka

Willy Denoyette [MVP] a écrit :

> You wont run 4 asp.net proceses don't you? but even if you did, the Windows
> OS uses a VM management system, so it does not mean that all memory
[quoted text clipped - 68 lines]
> > >
> > > Arkam
Willy Denoyette [MVP] - 02 Nov 2005 19:23 GMT
Well, if you run multiple w3wp to have to consider that you will need lots
of memory to begin with. Also I asked to look at the "Private bytes" and
"Working set" counters, but you keep insisting on the CLR counters that have
NO value here, and YES the memory is returned to the system if the system
needs it it will take it believe me, reserved or not. Of course if all of
your w3wp processes use 500MB at some point in time and you have a lot of
them you will need a lot of memory. As for your managed memory consumption,
did you ever consider to use a memory profiler to measure your allocation
pattern?

Willy.

We are running many w3wp process (we use AppPools).

What you describe is exactly what happens!

Our application needs sometimes a lot of memory for short times.
But this part:
"that means 500 MB has returned to the system."
is wrong because the system cannot use these 500MB anymore because they
are "reserved" for our w3wp process !

What can we do ?

Arka

Willy Denoyette [MVP] a écrit :

> You wont run 4 asp.net proceses don't you? but even if you did, the
> Windows
[quoted text clipped - 78 lines]
> > >
> > > Arkam

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.