My boss so cheap!! Our ASP.NET only have 256MB only! How to release request used memory when Page Un

A

ABC

My boss so cheap!! Our ASP.NET only have 256MB only! How to release request
used memory when Page Unload() event raise? If not release memory and wait
session time out, it will make very very slow.
 
K

Kevin Spencer

I think you have 2 alternatives. You can convince your boss that RAM costs
less than an hour or 2 of developer time, or you can switch to something
like ASP, which uses less memory.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
F

Friso Wiskerke

You cal call the GC.Collect() method. This doesn't clean-up resources
immediately but does clean them up faster than if you just wait for the GC
to do it's job....

You're better off ripping the 256MB RAM out your bosses PC and claiming it
for yourself . Then let's see how fast he'll buy some xtra DIMMs' ;-)

Greetz,
Friso Wiskerke
 
J

Jim Cheshire

Friso said:
You cal call the GC.Collect() method. This doesn't clean-up resources
immediately but does clean them up faster than if you just wait for
the GC to do it's job....

You really shouldn't do this. If you call GC.Collect indiscriminately, you
just end up throwing off the GC's collection algorithm and things will be
worse off. There are times when an explicit call to GC.Collect is warranted.
This isn't one of them.

--
Jim Cheshire
================================
Blog: http://blogs.msdn.com/jamesche

Latest entry:
Getting the PID and TID of a COM Call

Describes how to get the PID of the
dllhost process a COM call is executing
in and how to locate the thread as well.
 
A

ABC

The boss's points as:

1. SD-RAM is old ram, if buy new SD-RAM, it will noused for future!
2. If add RAM, it is cost!!
3. Don't to spend money any hardware!!

so cheap boss!!!
 
K

Kevin Spencer

Hardware is the single least expensive cost factor in software development.

Man-hours are the single most expensive cost factor in software development.

so stupid boss!!!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
L

Luke Dalessandro

GC should do a pretty good job of this. You could try forcing it by
writing a custom IHttpHandler with something like this code in it's
Process routine:

using (Page page =
(Page)PageParser.GetCompiledPageInstance(context.Request.CurrentExecutionFilePath,
context.Request.PhysicalPath, context))
{
page.ProcessRequest(context);
}

I'm not sure what kind of result this will have. The page variable will
be dealocated after the ProcessRequest call. I don't know what kind of
threading issues there are here.

See http://msdn2.microsoft.com/library/yh598w02.aspx for "using"
information.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top