Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Memory leak in ASP.Net at each post back

Memory leak in ASP.Net at each post back

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsysadminperformance
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Grapes R Fun
    wrote on last edited by
    #1

    Hello friends, I don't know why I have memory leak (on client browser, not the server) at each postback, even on pages that don't use any javascripts or 3rd party RAD controls (which often use leaky javascript!). Does anyone know why this happens?

    Nila

    P D 2 Replies Last reply
    0
    • G Grapes R Fun

      Hello friends, I don't know why I have memory leak (on client browser, not the server) at each postback, even on pages that don't use any javascripts or 3rd party RAD controls (which often use leaky javascript!). Does anyone know why this happens?

      Nila

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Sounds like the viewstate is getting bigger and bigger. Try disabling the viewstate altogether, perform a few postbacks and see what happens to the memory then.

      the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
      Deja View - the feeling that you've seen this post before.

      G 1 Reply Last reply
      0
      • G Grapes R Fun

        Hello friends, I don't know why I have memory leak (on client browser, not the server) at each postback, even on pages that don't use any javascripts or 3rd party RAD controls (which often use leaky javascript!). Does anyone know why this happens?

        Nila

        D Offline
        D Offline
        dalbhide bipin
        wrote on last edited by
        #3

        hi nila.. thank u very much... keep in touch

        1 Reply Last reply
        0
        • P Pete OHanlon

          Sounds like the viewstate is getting bigger and bigger. Try disabling the viewstate altogether, perform a few postbacks and see what happens to the memory then.

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          G Offline
          G Offline
          Grapes R Fun
          wrote on last edited by
          #4

          uhh... i H-A-T-E viewstate but it's just too convenient. Do you think it's a good idea to store the between-postback data in session instead? If so, would you suggest storing it on client or server?

          Nila

          P N 2 Replies Last reply
          0
          • G Grapes R Fun

            uhh... i H-A-T-E viewstate but it's just too convenient. Do you think it's a good idea to store the between-postback data in session instead? If so, would you suggest storing it on client or server?

            Nila

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            I would just assess what needs to be stored in the viewstate and then turn off anything that doesn't. Yes, it is convenient, and to be honest it is a huge time saver. Bear in mind that the "memory consumed" at the browser should be reclaimed whatever was used.

            the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
            Deja View - the feeling that you've seen this post before.

            1 Reply Last reply
            0
            • G Grapes R Fun

              uhh... i H-A-T-E viewstate but it's just too convenient. Do you think it's a good idea to store the between-postback data in session instead? If so, would you suggest storing it on client or server?

              Nila

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              Grapes-R-Fun wrote:

              Do you think it's a good idea to store the between-postback data in session instead?

              Remember that session state is stored on the server. If you have a site with 100's or 1000's of users, that can be a real drain (depending on how much you store) on the server and reduce the number of users you can serve. Also if you use a webfarm it becomes much more challenging using session state this way.


              only two letters away from being an asset

              G 1 Reply Last reply
              0
              • N Not Active

                Grapes-R-Fun wrote:

                Do you think it's a good idea to store the between-postback data in session instead?

                Remember that session state is stored on the server. If you have a site with 100's or 1000's of users, that can be a real drain (depending on how much you store) on the server and reduce the number of users you can serve. Also if you use a webfarm it becomes much more challenging using session state this way.


                only two letters away from being an asset

                G Offline
                G Offline
                Grapes R Fun
                wrote on last edited by
                #7

                Silly me, I must have confused the session with cache :-O During the most severe case, at most I will have 400 people using it, and I have only one virtualized server (that's another 'uhhh' story) to dish out this app. Now when Im done with a variable that is stored in session, if I set its value to null will the space be conserved, or do I pretty much have to abandon/timeout session all together?

                Nila

                N 1 Reply Last reply
                0
                • G Grapes R Fun

                  Silly me, I must have confused the session with cache :-O During the most severe case, at most I will have 400 people using it, and I have only one virtualized server (that's another 'uhhh' story) to dish out this app. Now when Im done with a variable that is stored in session, if I set its value to null will the space be conserved, or do I pretty much have to abandon/timeout session all together?

                  Nila

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #8

                  The memory isn't really going to be recovered until the GC gets around to it. Although it doesn't seem as though your app would have any difficulties if you limited what you were storing. Keep in mind that IIS will scavange memory when needed, so you may lose session state from whatever sessions it determines are no longer in use, even if they are.


                  only two letters away from being an asset

                  G 1 Reply Last reply
                  0
                  • N Not Active

                    The memory isn't really going to be recovered until the GC gets around to it. Although it doesn't seem as though your app would have any difficulties if you limited what you were storing. Keep in mind that IIS will scavange memory when needed, so you may lose session state from whatever sessions it determines are no longer in use, even if they are.


                    only two letters away from being an asset

                    G Offline
                    G Offline
                    Grapes R Fun
                    wrote on last edited by
                    #9

                    Thanks a bunch Mark!! I really like your signature, btw - it's so witty :-)

                    Nila

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups