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

Discussion in 'ASP .Net' started by ABC, Jan 12, 2006.

  1. ABC

    ABC Guest

    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.
    ABC, Jan 12, 2006
    #1
    1. Advertising

  2. ABC

    Josh Twist Guest

    GC (Garbage Collection) should clean up managed resources for you -
    particularly when there is memory pressure, of which I expect there to
    be plenty on your low ram servers!

    Josh
    http://www.thejoyofcode.com/
    Josh Twist, Jan 12, 2006
    #2
    1. Advertising

  3. 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.

    "ABC" <> wrote in message
    news:%23w$...
    > 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.
    >
    >
    Kevin Spencer, Jan 12, 2006
    #3
  4. 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

    "Josh Twist" <> wrote in message
    news:...
    > GC (Garbage Collection) should clean up managed resources for you -
    > particularly when there is memory pressure, of which I expect there to
    > be plenty on your low ram servers!
    >
    > Josh
    > http://www.thejoyofcode.com/
    >
    Friso Wiskerke, Jan 12, 2006
    #4
  5. ABC

    Jim Cheshire Guest

    Friso Wiskerke wrote:
    > 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.
    Jim Cheshire, Jan 12, 2006
    #5
  6. ABC

    ABC Guest

    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!!!





    "Kevin Spencer" <> wrote in message
    news:%...
    >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.
    >
    > "ABC" <> wrote in message
    > news:%23w$...
    >> 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.
    >>
    >>

    >
    >
    ABC, Jan 13, 2006
    #6
  7. 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.

    "ABC" <> wrote in message
    news:OI38ki%...
    > 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!!!
    >
    >
    >
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:%...
    >>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.
    >>
    >> "ABC" <> wrote in message
    >> news:%23w$...
    >>> 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.
    >>>
    >>>

    >>
    >>

    >
    >
    Kevin Spencer, Jan 13, 2006
    #7
  8. Re: My boss so cheap!! Our ASP.NET only have 256MB only! How to releaserequest used memory when Page Unload() event raise?

    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

    ABC wrote:
    > 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.
    >
    >
    Luke Dalessandro, Jan 13, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rod
    Replies:
    3
    Views:
    356
    Karl Seguin
    Dec 13, 2004
  2. max khesin
    Replies:
    1
    Views:
    245
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Feb 14, 2004
  3. Replies:
    27
    Views:
    806
    Riccardo Galli
    Jul 2, 2005
  4. POLO TSHIRT
    Replies:
    0
    Views:
    193
    POLO TSHIRT
    Nov 8, 2010
  5. Bo
    Replies:
    2
    Views:
    171
    Phill. W
    Feb 25, 2005
Loading...

Share This Page