maximum .net process can use

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zen

    #16
    Re: maximum .net process can use

    thanks for the information. By the way, I'm not clear on how the author of
    the article came up with the 800MB as a good threshold for "Process\Privat e
    Bytes"? I restructured my code to reduce memory consumption peak (it's long
    to explain it but it including removing a website from the server) and it's
    running fine even when the "Private Bytes" goes up to 1.3G. I suspect that
    the MEM_RESERVE regions go up for each additional website as well but I
    still don't get the 800MB threshold, could someone explain? Thanks!

    Also, I was setting the memory max to 80% instead of 60% hoping to solve the
    problem. I'm changing it back down to 65% now.


    "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
    news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...[color=blue]
    > See this info (it's long)
    > http://msdn.microsoft.com/library/de...nitor_perf.asp
    >
    > A quote:
    > First, the likelihood of experiencing an OutOfMemoryExce ption begins to
    > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of the
    > virtual address space limit (generally 2 GB), and secondly, tests have
    > shown
    > that "Process\Virtua l Bytes" is often larger than "Process\Privat e Bytes"
    > by
    > no more than 600 MB. This difference is due in part to the MEM_RESERVE
    > regions maintained by the GC, allowing it to quickly commit more memory
    > when
    > needed. Taken together this implies that when "Process\Privat e Bytes"
    > exceeds
    > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption increases.
    >
    > Long story short, asp.net 1.1 with has a high likelyhood of experiencing
    > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800 MB due to
    > address space limitations and additional reserve by the GC.
    >
    > The below applies to IIS 5.0. For IIS 6.0, you would set this up from IIS
    > Manager Properties -> Recycling -> Maximum used memory. But one of your
    > other posts indicated you were using Win 2k server, so you don't have IIS
    > 6.0.
    >
    > The memorylimit defaults to 60% of available RAM, which is why you didn't
    > have any issues while you only had 1 GB. Now that you have 2 GB,
    > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over the 800
    > MB
    > problem point. You'll want to set the memoryLimit in the your
    > machine.config
    > setting for processModel to a value that doesn't exceed 800 MB. For a 2
    > GB
    > machine, 39% will do the trick.
    >
    > If you have enough RAM to where you have included the /3GB switch to
    > boot.ini, you can use a value that calculates out to 1,800 MB instead.
    >
    > I'd also recommend lowering the timout and idelTimout values from
    > Infinite,
    > to a lower value. This will allow the aspnet_wp.exe process to actually
    > recycle.
    >
    > "Zen" wrote:
    >[color=green]
    >> Hi,
    >>
    >> My production machine has 2G of memory, when aspnet_wp.exe goes up to
    >> about
    >> ~1.2G of memory usage, I start get out-of-memory exception. Other
    >> processes
    >> don't use as much memory and I added all the peak memory usage of all the
    >> processes (including aspnet_wp.exe), it goes up to no more than 1.5.
    >>
    >> How is that possible? Would anyone know please help? thanks!
    >>
    >>
    >>[/color][/color]


    Comment

    • Willy Denoyette [MVP]

      #17
      Re: maximum .net process can use

      Zen,

      You should read the article carefully, the threshold is an empirical one
      based on experiments using a typical application on a version (v1.1) of the
      framework. But it's nothing else than a (dirty) trick, it sets the threshold
      at such a low level that it forces the process to recycle before you
      possibly have a chance to encounter an OOM exception, it's 'dirty' because
      it may hide a bug (or design flaw) in your code and it side-steps the LOH
      fragmentation problem typical for v1.0 and v1.1 (non SP1) of the framework.

      You did change your code to reduce the memory consumption, but still your
      memory consumption reaches 1.3 GB, so I guess you did refactor your code
      such that there is less (or no?) fragmentation of the LOH. But again, once
      the heap becomes too fragmented you are at risk for OOM's. Now the point is
      what do you prefer, process recycling or OOM's, for me the two are equally
      bad, you didn't pay for 2GB of memory to only use 60% of it didn't you?
      So, I repeat it again, profile your web application take a look at the
      allocation pattern, that's the only way to prevent/reduce fragmentation in a
      server like application. If you can eliminate fragmentation completely, your
      application will live a long, well performing and healthy life :-), if you
      can't eliminate fragmentation, you will have to live with process recycling
      or OOM's, the choice is yours.

      Willy.





      "Zen" <zen@nononospam .com> wrote in message
      news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
      | thanks for the information. By the way, I'm not clear on how the author
      of
      | the article came up with the 800MB as a good threshold for
      "Process\Privat e
      | Bytes"? I restructured my code to reduce memory consumption peak (it's
      long
      | to explain it but it including removing a website from the server) and
      it's
      | running fine even when the "Private Bytes" goes up to 1.3G. I suspect
      that
      | the MEM_RESERVE regions go up for each additional website as well but I
      | still don't get the 800MB threshold, could someone explain? Thanks!
      |
      | Also, I was setting the memory max to 80% instead of 60% hoping to solve
      the
      | problem. I'm changing it back down to 65% now.
      |
      |
      | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
      | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
      | > See this info (it's long)
      | >

      | >
      | > A quote:
      | > First, the likelihood of experiencing an OutOfMemoryExce ption begins to
      | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of
      the
      | > virtual address space limit (generally 2 GB), and secondly, tests have
      | > shown
      | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
      Bytes"
      | > by
      | > no more than 600 MB. This difference is due in part to the MEM_RESERVE
      | > regions maintained by the GC, allowing it to quickly commit more memory
      | > when
      | > needed. Taken together this implies that when "Process\Privat e Bytes"
      | > exceeds
      | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
      increases.
      | >
      | > Long story short, asp.net 1.1 with has a high likelyhood of experiencing
      | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800 MB due
      to
      | > address space limitations and additional reserve by the GC.
      | >
      | > The below applies to IIS 5.0. For IIS 6.0, you would set this up from
      IIS
      | > Manager Properties -> Recycling -> Maximum used memory. But one of your
      | > other posts indicated you were using Win 2k server, so you don't have
      IIS
      | > 6.0.
      | >
      | > The memorylimit defaults to 60% of available RAM, which is why you
      didn't
      | > have any issues while you only had 1 GB. Now that you have 2 GB,
      | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over the
      800
      | > MB
      | > problem point. You'll want to set the memoryLimit in the your
      | > machine.config
      | > setting for processModel to a value that doesn't exceed 800 MB. For a 2
      | > GB
      | > machine, 39% will do the trick.
      | >
      | > If you have enough RAM to where you have included the /3GB switch to
      | > boot.ini, you can use a value that calculates out to 1,800 MB instead.
      | >
      | > I'd also recommend lowering the timout and idelTimout values from
      | > Infinite,
      | > to a lower value. This will allow the aspnet_wp.exe process to actually
      | > recycle.
      | >
      | > "Zen" wrote:
      | >
      | >> Hi,
      | >>
      | >> My production machine has 2G of memory, when aspnet_wp.exe goes up to
      | >> about
      | >> ~1.2G of memory usage, I start get out-of-memory exception. Other
      | >> processes
      | >> don't use as much memory and I added all the peak memory usage of all
      the
      | >> processes (including aspnet_wp.exe), it goes up to no more than 1.5.
      | >>
      | >> How is that possible? Would anyone know please help? thanks!
      | >>
      | >>
      | >>
      |
      |


      Comment

      • Neyah

        #18
        Re: maximum .net process can use

        I didn't indicate that Zen should not profile the application and attempt to
        reduce memory consumption. I merely replied to the original question of "How
        is this possible?" and directed him to an article that answered the question.

        Zen, the relevant portion of the article where they indicated to use 800 MB
        is as follows:
        First, the likelihood of experiencing an OutOfMemoryExce ption begins to
        increase dramatically when "Process\Virtua l Bytes" is within 600 MB of the
        virtual address space limit (generally 2 GB), and secondly, tests have shown
        that "Process\Virtua l Bytes" is often larger than "Process\Privat e Bytes" by
        no more than 600 MB. This difference is due in part to the MEM_RESERVE
        regions maintained by the GC, allowing it to quickly commit more memory when
        needed. Taken together this implies that when "Process\Privat e Bytes" exceeds
        800 MB, the likelihood of experiencing an OutOfMemoryExce ption increases.

        You're not really out of memory, you're just out of address space for the
        worker process. This could be solved by utilizing the /3GB switch or
        switching to a 64 bit machine. You indicated that you don't have enough RAM
        to use /3GB, and purchasing a new machine isn't necessarily a real option.

        Please note that 2.0 has many optimizations to the way GC works, including
        the ability to reuse a fragmented LOH. You can run your 1.1 web application
        under 2.0 without having to recompile simply by going into IIS, going into
        ASP.NET tab in the properties for the affected IIS application directory, and
        changing the dropdown for ASP.NET Version from 1.1.4322 to 2.0.50727.

        If you aren't willing or aren't able to have 2.0 installed on your web
        server, I would say that your only option is to live with process recycling.
        I wouldn't consider constant OOMs with no way to recover from this state as a
        valid "choice".

        "Willy Denoyette [MVP]" wrote:
        [color=blue]
        > Zen,
        >
        > You should read the article carefully, the threshold is an empirical one
        > based on experiments using a typical application on a version (v1.1) of the
        > framework. But it's nothing else than a (dirty) trick, it sets the threshold
        > at such a low level that it forces the process to recycle before you
        > possibly have a chance to encounter an OOM exception, it's 'dirty' because
        > it may hide a bug (or design flaw) in your code and it side-steps the LOH
        > fragmentation problem typical for v1.0 and v1.1 (non SP1) of the framework.
        >
        > You did change your code to reduce the memory consumption, but still your
        > memory consumption reaches 1.3 GB, so I guess you did refactor your code
        > such that there is less (or no?) fragmentation of the LOH. But again, once
        > the heap becomes too fragmented you are at risk for OOM's. Now the point is
        > what do you prefer, process recycling or OOM's, for me the two are equally
        > bad, you didn't pay for 2GB of memory to only use 60% of it didn't you?
        > So, I repeat it again, profile your web application take a look at the
        > allocation pattern, that's the only way to prevent/reduce fragmentation in a
        > server like application. If you can eliminate fragmentation completely, your
        > application will live a long, well performing and healthy life :-), if you
        > can't eliminate fragmentation, you will have to live with process recycling
        > or OOM's, the choice is yours.
        >
        > Willy.
        >
        >
        >
        >
        >
        > "Zen" <zen@nononospam .com> wrote in message
        > news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
        > | thanks for the information. By the way, I'm not clear on how the author
        > of
        > | the article came up with the 800MB as a good threshold for
        > "Process\Privat e
        > | Bytes"? I restructured my code to reduce memory consumption peak (it's
        > long
        > | to explain it but it including removing a website from the server) and
        > it's
        > | running fine even when the "Private Bytes" goes up to 1.3G. I suspect
        > that
        > | the MEM_RESERVE regions go up for each additional website as well but I
        > | still don't get the 800MB threshold, could someone explain? Thanks!
        > |
        > | Also, I was setting the memory max to 80% instead of 60% hoping to solve
        > the
        > | problem. I'm changing it back down to 65% now.
        > |
        > |
        > | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
        > | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
        > | > See this info (it's long)
        > | >
        > http://msdn.microsoft.com/library/de...nitor_perf.asp
        > | >
        > | > A quote:
        > | > First, the likelihood of experiencing an OutOfMemoryExce ption begins to
        > | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of
        > the
        > | > virtual address space limit (generally 2 GB), and secondly, tests have
        > | > shown
        > | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
        > Bytes"
        > | > by
        > | > no more than 600 MB. This difference is due in part to the MEM_RESERVE
        > | > regions maintained by the GC, allowing it to quickly commit more memory
        > | > when
        > | > needed. Taken together this implies that when "Process\Privat e Bytes"
        > | > exceeds
        > | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
        > increases.
        > | >
        > | > Long story short, asp.net 1.1 with has a high likelyhood of experiencing
        > | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800 MB due
        > to
        > | > address space limitations and additional reserve by the GC.
        > | >
        > | > The below applies to IIS 5.0. For IIS 6.0, you would set this up from
        > IIS
        > | > Manager Properties -> Recycling -> Maximum used memory. But one of your
        > | > other posts indicated you were using Win 2k server, so you don't have
        > IIS
        > | > 6.0.
        > | >
        > | > The memorylimit defaults to 60% of available RAM, which is why you
        > didn't
        > | > have any issues while you only had 1 GB. Now that you have 2 GB,
        > | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over the
        > 800
        > | > MB
        > | > problem point. You'll want to set the memoryLimit in the your
        > | > machine.config
        > | > setting for processModel to a value that doesn't exceed 800 MB. For a 2
        > | > GB
        > | > machine, 39% will do the trick.
        > | >
        > | > If you have enough RAM to where you have included the /3GB switch to
        > | > boot.ini, you can use a value that calculates out to 1,800 MB instead.
        > | >
        > | > I'd also recommend lowering the timout and idelTimout values from
        > | > Infinite,
        > | > to a lower value. This will allow the aspnet_wp.exe process to actually
        > | > recycle.
        > | >
        > | > "Zen" wrote:
        > | >
        > | >> Hi,
        > | >>
        > | >> My production machine has 2G of memory, when aspnet_wp.exe goes up to
        > | >> about
        > | >> ~1.2G of memory usage, I start get out-of-memory exception. Other
        > | >> processes
        > | >> don't use as much memory and I added all the peak memory usage of all
        > the
        > | >> processes (including aspnet_wp.exe), it goes up to no more than 1.5.
        > | >>
        > | >> How is that possible? Would anyone know please help? thanks!
        > | >>
        > | >>
        > | >>
        > |
        > |
        >
        >
        >[/color]

        Comment

        • Willy Denoyette [MVP]

          #19
          Re: maximum .net process can use

          Inline

          Willy.

          "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
          news:35BB8BE3-5BA9-41D1-8122-CCF988684E72@mi crosoft.com...
          |I didn't indicate that Zen should not profile the application and attempt
          to
          | reduce memory consumption. I merely replied to the original question of
          "How
          | is this possible?" and directed him to an article that answered the
          question.
          |

          Hmm ... I merely replied (to Zen) to say that the article is quite old, it's
          based on a version of the CLR that had problems with LOH fragmentation, and
          the most importantly, that you should not take such artices as gospel just
          use it as a reference but no more, you have to measure/profile yourself (do
          your homework), your application might be totally different with different
          load patterns and allocation profiles. But, before you do make sure you know
          what and how to measure, you should know how Windows virtual memory system
          works, how things like Physical RAM, address spaces and virtual memory
          relate, and what the role of the GC is in this whole story.


          Willy.


          Comment

          • Zen

            #20
            Re: maximum .net process can use

            When memoryLimit threshold is reached, does Aspnet process know to call
            GC.GetTotalMemo ry(true) to ensure that it's a real violation of the limit
            before recycling itself?

            thanks!

            "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
            news:35BB8BE3-5BA9-41D1-8122-CCF988684E72@mi crosoft.com...[color=blue]
            >I didn't indicate that Zen should not profile the application and attempt
            >to
            > reduce memory consumption. I merely replied to the original question of
            > "How
            > is this possible?" and directed him to an article that answered the
            > question.
            >
            > Zen, the relevant portion of the article where they indicated to use 800
            > MB
            > is as follows:
            > First, the likelihood of experiencing an OutOfMemoryExce ption begins to
            > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of the
            > virtual address space limit (generally 2 GB), and secondly, tests have
            > shown
            > that "Process\Virtua l Bytes" is often larger than "Process\Privat e Bytes"
            > by
            > no more than 600 MB. This difference is due in part to the MEM_RESERVE
            > regions maintained by the GC, allowing it to quickly commit more memory
            > when
            > needed. Taken together this implies that when "Process\Privat e Bytes"
            > exceeds
            > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption increases.
            >
            > You're not really out of memory, you're just out of address space for the
            > worker process. This could be solved by utilizing the /3GB switch or
            > switching to a 64 bit machine. You indicated that you don't have enough
            > RAM
            > to use /3GB, and purchasing a new machine isn't necessarily a real option.
            >
            > Please note that 2.0 has many optimizations to the way GC works, including
            > the ability to reuse a fragmented LOH. You can run your 1.1 web
            > application
            > under 2.0 without having to recompile simply by going into IIS, going into
            > ASP.NET tab in the properties for the affected IIS application directory,
            > and
            > changing the dropdown for ASP.NET Version from 1.1.4322 to 2.0.50727.
            >
            > If you aren't willing or aren't able to have 2.0 installed on your web
            > server, I would say that your only option is to live with process
            > recycling.
            > I wouldn't consider constant OOMs with no way to recover from this state
            > as a
            > valid "choice".
            >
            > "Willy Denoyette [MVP]" wrote:
            >[color=green]
            >> Zen,
            >>
            >> You should read the article carefully, the threshold is an empirical one
            >> based on experiments using a typical application on a version (v1.1) of
            >> the
            >> framework. But it's nothing else than a (dirty) trick, it sets the
            >> threshold
            >> at such a low level that it forces the process to recycle before you
            >> possibly have a chance to encounter an OOM exception, it's 'dirty'
            >> because
            >> it may hide a bug (or design flaw) in your code and it side-steps the LOH
            >> fragmentation problem typical for v1.0 and v1.1 (non SP1) of the
            >> framework.
            >>
            >> You did change your code to reduce the memory consumption, but still
            >> your
            >> memory consumption reaches 1.3 GB, so I guess you did refactor your code
            >> such that there is less (or no?) fragmentation of the LOH. But again,
            >> once
            >> the heap becomes too fragmented you are at risk for OOM's. Now the point
            >> is
            >> what do you prefer, process recycling or OOM's, for me the two are
            >> equally
            >> bad, you didn't pay for 2GB of memory to only use 60% of it didn't you?
            >> So, I repeat it again, profile your web application take a look at the
            >> allocation pattern, that's the only way to prevent/reduce fragmentation
            >> in a
            >> server like application. If you can eliminate fragmentation completely,
            >> your
            >> application will live a long, well performing and healthy life :-), if
            >> you
            >> can't eliminate fragmentation, you will have to live with process
            >> recycling
            >> or OOM's, the choice is yours.
            >>
            >> Willy.
            >>
            >>
            >>
            >>
            >>
            >> "Zen" <zen@nononospam .com> wrote in message
            >> news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
            >> | thanks for the information. By the way, I'm not clear on how the
            >> author
            >> of
            >> | the article came up with the 800MB as a good threshold for
            >> "Process\Privat e
            >> | Bytes"? I restructured my code to reduce memory consumption peak (it's
            >> long
            >> | to explain it but it including removing a website from the server) and
            >> it's
            >> | running fine even when the "Private Bytes" goes up to 1.3G. I suspect
            >> that
            >> | the MEM_RESERVE regions go up for each additional website as well but I
            >> | still don't get the 800MB threshold, could someone explain? Thanks!
            >> |
            >> | Also, I was setting the memory max to 80% instead of 60% hoping to
            >> solve
            >> the
            >> | problem. I'm changing it back down to 65% now.
            >> |
            >> |
            >> | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
            >> | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
            >> | > See this info (it's long)
            >> | >
            >> http://msdn.microsoft.com/library/de...nitor_perf.asp
            >> | >
            >> | > A quote:
            >> | > First, the likelihood of experiencing an OutOfMemoryExce ption begins
            >> to
            >> | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB
            >> of
            >> the
            >> | > virtual address space limit (generally 2 GB), and secondly, tests
            >> have
            >> | > shown
            >> | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
            >> Bytes"
            >> | > by
            >> | > no more than 600 MB. This difference is due in part to the
            >> MEM_RESERVE
            >> | > regions maintained by the GC, allowing it to quickly commit more
            >> memory
            >> | > when
            >> | > needed. Taken together this implies that when "Process\Privat e Bytes"
            >> | > exceeds
            >> | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
            >> increases.
            >> | >
            >> | > Long story short, asp.net 1.1 with has a high likelyhood of
            >> experiencing
            >> | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800 MB
            >> due
            >> to
            >> | > address space limitations and additional reserve by the GC.
            >> | >
            >> | > The below applies to IIS 5.0. For IIS 6.0, you would set this up
            >> from
            >> IIS
            >> | > Manager Properties -> Recycling -> Maximum used memory. But one of
            >> your
            >> | > other posts indicated you were using Win 2k server, so you don't have
            >> IIS
            >> | > 6.0.
            >> | >
            >> | > The memorylimit defaults to 60% of available RAM, which is why you
            >> didn't
            >> | > have any issues while you only had 1 GB. Now that you have 2 GB,
            >> | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over
            >> the
            >> 800
            >> | > MB
            >> | > problem point. You'll want to set the memoryLimit in the your
            >> | > machine.config
            >> | > setting for processModel to a value that doesn't exceed 800 MB. For
            >> a 2
            >> | > GB
            >> | > machine, 39% will do the trick.
            >> | >
            >> | > If you have enough RAM to where you have included the /3GB switch to
            >> | > boot.ini, you can use a value that calculates out to 1,800 MB
            >> instead.
            >> | >
            >> | > I'd also recommend lowering the timout and idelTimout values from
            >> | > Infinite,
            >> | > to a lower value. This will allow the aspnet_wp.exe process to
            >> actually
            >> | > recycle.
            >> | >
            >> | > "Zen" wrote:
            >> | >
            >> | >> Hi,
            >> | >>
            >> | >> My production machine has 2G of memory, when aspnet_wp.exe goes up
            >> to
            >> | >> about
            >> | >> ~1.2G of memory usage, I start get out-of-memory exception. Other
            >> | >> processes
            >> | >> don't use as much memory and I added all the peak memory usage of
            >> all
            >> the
            >> | >> processes (including aspnet_wp.exe), it goes up to no more than 1.5.
            >> | >>
            >> | >> How is that possible? Would anyone know please help? thanks!
            >> | >>
            >> | >>
            >> | >>
            >> |
            >> |
            >>
            >>
            >>[/color][/color]


            Comment

            • Willy Denoyette [MVP]

              #21
              Re: maximum .net process can use

              The worker process is an unmanaged host, it doesn't have to call anything to
              know if the threshold has been reached, it calls the OS services (and the
              CLR services through the hosting interface) for this and exits when a
              threshold is reached or when a deadlock is detected etc...
              The aspnet ISAPI dll restarts the process when this happens.
              Note also that GC.GetTotalMemo ry only returns the GC allocated memory, and
              that's not the threshold we are talking about.

              Willy.



              "Zen" <zen@nononospam .com> wrote in message
              news:O53yVrgHGH A.2036@TK2MSFTN GP14.phx.gbl...
              | When memoryLimit threshold is reached, does Aspnet process know to call
              | GC.GetTotalMemo ry(true) to ensure that it's a real violation of the limit
              | before recycling itself?
              |
              | thanks!
              |
              | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
              | news:35BB8BE3-5BA9-41D1-8122-CCF988684E72@mi crosoft.com...
              | >I didn't indicate that Zen should not profile the application and attempt
              | >to
              | > reduce memory consumption. I merely replied to the original question of
              | > "How
              | > is this possible?" and directed him to an article that answered the
              | > question.
              | >
              | > Zen, the relevant portion of the article where they indicated to use 800
              | > MB
              | > is as follows:
              | > First, the likelihood of experiencing an OutOfMemoryExce ption begins to
              | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of
              the
              | > virtual address space limit (generally 2 GB), and secondly, tests have
              | > shown
              | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
              Bytes"
              | > by
              | > no more than 600 MB. This difference is due in part to the MEM_RESERVE
              | > regions maintained by the GC, allowing it to quickly commit more memory
              | > when
              | > needed. Taken together this implies that when "Process\Privat e Bytes"
              | > exceeds
              | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
              increases.
              | >
              | > You're not really out of memory, you're just out of address space for
              the
              | > worker process. This could be solved by utilizing the /3GB switch or
              | > switching to a 64 bit machine. You indicated that you don't have enough
              | > RAM
              | > to use /3GB, and purchasing a new machine isn't necessarily a real
              option.
              | >
              | > Please note that 2.0 has many optimizations to the way GC works,
              including
              | > the ability to reuse a fragmented LOH. You can run your 1.1 web
              | > application
              | > under 2.0 without having to recompile simply by going into IIS, going
              into
              | > ASP.NET tab in the properties for the affected IIS application
              directory,
              | > and
              | > changing the dropdown for ASP.NET Version from 1.1.4322 to 2.0.50727.
              | >
              | > If you aren't willing or aren't able to have 2.0 installed on your web
              | > server, I would say that your only option is to live with process
              | > recycling.
              | > I wouldn't consider constant OOMs with no way to recover from this state
              | > as a
              | > valid "choice".
              | >
              | > "Willy Denoyette [MVP]" wrote:
              | >
              | >> Zen,
              | >>
              | >> You should read the article carefully, the threshold is an empirical
              one
              | >> based on experiments using a typical application on a version (v1.1) of
              | >> the
              | >> framework. But it's nothing else than a (dirty) trick, it sets the
              | >> threshold
              | >> at such a low level that it forces the process to recycle before you
              | >> possibly have a chance to encounter an OOM exception, it's 'dirty'
              | >> because
              | >> it may hide a bug (or design flaw) in your code and it side-steps the
              LOH
              | >> fragmentation problem typical for v1.0 and v1.1 (non SP1) of the
              | >> framework.
              | >>
              | >> You did change your code to reduce the memory consumption, but still
              | >> your
              | >> memory consumption reaches 1.3 GB, so I guess you did refactor your
              code
              | >> such that there is less (or no?) fragmentation of the LOH. But again,
              | >> once
              | >> the heap becomes too fragmented you are at risk for OOM's. Now the
              point
              | >> is
              | >> what do you prefer, process recycling or OOM's, for me the two are
              | >> equally
              | >> bad, you didn't pay for 2GB of memory to only use 60% of it didn't you?
              | >> So, I repeat it again, profile your web application take a look at the
              | >> allocation pattern, that's the only way to prevent/reduce fragmentation
              | >> in a
              | >> server like application. If you can eliminate fragmentation completely,
              | >> your
              | >> application will live a long, well performing and healthy life :-), if
              | >> you
              | >> can't eliminate fragmentation, you will have to live with process
              | >> recycling
              | >> or OOM's, the choice is yours.
              | >>
              | >> Willy.
              | >>
              | >>
              | >>
              | >>
              | >>
              | >> "Zen" <zen@nononospam .com> wrote in message
              | >> news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
              | >> | thanks for the information. By the way, I'm not clear on how the
              | >> author
              | >> of
              | >> | the article came up with the 800MB as a good threshold for
              | >> "Process\Privat e
              | >> | Bytes"? I restructured my code to reduce memory consumption peak
              (it's
              | >> long
              | >> | to explain it but it including removing a website from the server)
              and
              | >> it's
              | >> | running fine even when the "Private Bytes" goes up to 1.3G. I
              suspect
              | >> that
              | >> | the MEM_RESERVE regions go up for each additional website as well but
              I
              | >> | still don't get the 800MB threshold, could someone explain? Thanks!
              | >> |
              | >> | Also, I was setting the memory max to 80% instead of 60% hoping to
              | >> solve
              | >> the
              | >> | problem. I'm changing it back down to 65% now.
              | >> |
              | >> |
              | >> | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
              | >> | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
              | >> | > See this info (it's long)
              | >> | >
              | >>

              | >> | >
              | >> | > A quote:
              | >> | > First, the likelihood of experiencing an OutOfMemoryExce ption
              begins
              | >> to
              | >> | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB
              | >> of
              | >> the
              | >> | > virtual address space limit (generally 2 GB), and secondly, tests
              | >> have
              | >> | > shown
              | >> | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
              | >> Bytes"
              | >> | > by
              | >> | > no more than 600 MB. This difference is due in part to the
              | >> MEM_RESERVE
              | >> | > regions maintained by the GC, allowing it to quickly commit more
              | >> memory
              | >> | > when
              | >> | > needed. Taken together this implies that when "Process\Privat e
              Bytes"
              | >> | > exceeds
              | >> | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
              | >> increases.
              | >> | >
              | >> | > Long story short, asp.net 1.1 with has a high likelyhood of
              | >> experiencing
              | >> | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800 MB
              | >> due
              | >> to
              | >> | > address space limitations and additional reserve by the GC.
              | >> | >
              | >> | > The below applies to IIS 5.0. For IIS 6.0, you would set this up
              | >> from
              | >> IIS
              | >> | > Manager Properties -> Recycling -> Maximum used memory. But one of
              | >> your
              | >> | > other posts indicated you were using Win 2k server, so you don't
              have
              | >> IIS
              | >> | > 6.0.
              | >> | >
              | >> | > The memorylimit defaults to 60% of available RAM, which is why you
              | >> didn't
              | >> | > have any issues while you only had 1 GB. Now that you have 2 GB,
              | >> | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over
              | >> the
              | >> 800
              | >> | > MB
              | >> | > problem point. You'll want to set the memoryLimit in the your
              | >> | > machine.config
              | >> | > setting for processModel to a value that doesn't exceed 800 MB.
              For
              | >> a 2
              | >> | > GB
              | >> | > machine, 39% will do the trick.
              | >> | >
              | >> | > If you have enough RAM to where you have included the /3GB switch
              to
              | >> | > boot.ini, you can use a value that calculates out to 1,800 MB
              | >> instead.
              | >> | >
              | >> | > I'd also recommend lowering the timout and idelTimout values from
              | >> | > Infinite,
              | >> | > to a lower value. This will allow the aspnet_wp.exe process to
              | >> actually
              | >> | > recycle.
              | >> | >
              | >> | > "Zen" wrote:
              | >> | >
              | >> | >> Hi,
              | >> | >>
              | >> | >> My production machine has 2G of memory, when aspnet_wp.exe goes up
              | >> to
              | >> | >> about
              | >> | >> ~1.2G of memory usage, I start get out-of-memory exception. Other
              | >> | >> processes
              | >> | >> don't use as much memory and I added all the peak memory usage of
              | >> all
              | >> the
              | >> | >> processes (including aspnet_wp.exe), it goes up to no more than
              1.5.
              | >> | >>
              | >> | >> How is that possible? Would anyone know please help? thanks!
              | >> | >>
              | >> | >>
              | >> | >>
              | >> |
              | >> |
              | >>
              | >>
              | >>
              |
              |


              Comment

              • Zen

                #22
                Re: maximum .net process can use

                According to the documentation that Neyah, when we pass "true" to the
                GetTotalMemory( ) it actually calls other methods until it "seems" nothing
                left to be collected (5% stability) then it returns.


                "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
                news:uFc2bNhHGH A.344@TK2MSFTNG P11.phx.gbl...[color=blue]
                > The worker process is an unmanaged host, it doesn't have to call anything
                > to
                > know if the threshold has been reached, it calls the OS services (and the
                > CLR services through the hosting interface) for this and exits when a
                > threshold is reached or when a deadlock is detected etc...
                > The aspnet ISAPI dll restarts the process when this happens.
                > Note also that GC.GetTotalMemo ry only returns the GC allocated memory, and
                > that's not the threshold we are talking about.
                >
                > Willy.
                >
                >
                >
                > "Zen" <zen@nononospam .com> wrote in message
                > news:O53yVrgHGH A.2036@TK2MSFTN GP14.phx.gbl...
                > | When memoryLimit threshold is reached, does Aspnet process know to call
                > | GC.GetTotalMemo ry(true) to ensure that it's a real violation of the
                > limit
                > | before recycling itself?
                > |
                > | thanks!
                > |
                > | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
                > | news:35BB8BE3-5BA9-41D1-8122-CCF988684E72@mi crosoft.com...
                > | >I didn't indicate that Zen should not profile the application and
                > attempt
                > | >to
                > | > reduce memory consumption. I merely replied to the original question
                > of
                > | > "How
                > | > is this possible?" and directed him to an article that answered the
                > | > question.
                > | >
                > | > Zen, the relevant portion of the article where they indicated to use
                > 800
                > | > MB
                > | > is as follows:
                > | > First, the likelihood of experiencing an OutOfMemoryExce ption begins
                > to
                > | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB of
                > the
                > | > virtual address space limit (generally 2 GB), and secondly, tests have
                > | > shown
                > | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
                > Bytes"
                > | > by
                > | > no more than 600 MB. This difference is due in part to the MEM_RESERVE
                > | > regions maintained by the GC, allowing it to quickly commit more
                > memory
                > | > when
                > | > needed. Taken together this implies that when "Process\Privat e Bytes"
                > | > exceeds
                > | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
                > increases.
                > | >
                > | > You're not really out of memory, you're just out of address space for
                > the
                > | > worker process. This could be solved by utilizing the /3GB switch or
                > | > switching to a 64 bit machine. You indicated that you don't have
                > enough
                > | > RAM
                > | > to use /3GB, and purchasing a new machine isn't necessarily a real
                > option.
                > | >
                > | > Please note that 2.0 has many optimizations to the way GC works,
                > including
                > | > the ability to reuse a fragmented LOH. You can run your 1.1 web
                > | > application
                > | > under 2.0 without having to recompile simply by going into IIS, going
                > into
                > | > ASP.NET tab in the properties for the affected IIS application
                > directory,
                > | > and
                > | > changing the dropdown for ASP.NET Version from 1.1.4322 to 2.0.50727.
                > | >
                > | > If you aren't willing or aren't able to have 2.0 installed on your web
                > | > server, I would say that your only option is to live with process
                > | > recycling.
                > | > I wouldn't consider constant OOMs with no way to recover from this
                > state
                > | > as a
                > | > valid "choice".
                > | >
                > | > "Willy Denoyette [MVP]" wrote:
                > | >
                > | >> Zen,
                > | >>
                > | >> You should read the article carefully, the threshold is an empirical
                > one
                > | >> based on experiments using a typical application on a version (v1.1)
                > of
                > | >> the
                > | >> framework. But it's nothing else than a (dirty) trick, it sets the
                > | >> threshold
                > | >> at such a low level that it forces the process to recycle before you
                > | >> possibly have a chance to encounter an OOM exception, it's 'dirty'
                > | >> because
                > | >> it may hide a bug (or design flaw) in your code and it side-steps the
                > LOH
                > | >> fragmentation problem typical for v1.0 and v1.1 (non SP1) of the
                > | >> framework.
                > | >>
                > | >> You did change your code to reduce the memory consumption, but still
                > | >> your
                > | >> memory consumption reaches 1.3 GB, so I guess you did refactor your
                > code
                > | >> such that there is less (or no?) fragmentation of the LOH. But again,
                > | >> once
                > | >> the heap becomes too fragmented you are at risk for OOM's. Now the
                > point
                > | >> is
                > | >> what do you prefer, process recycling or OOM's, for me the two are
                > | >> equally
                > | >> bad, you didn't pay for 2GB of memory to only use 60% of it didn't
                > you?
                > | >> So, I repeat it again, profile your web application take a look at
                > the
                > | >> allocation pattern, that's the only way to prevent/reduce
                > fragmentation
                > | >> in a
                > | >> server like application. If you can eliminate fragmentation
                > completely,
                > | >> your
                > | >> application will live a long, well performing and healthy life :-),
                > if
                > | >> you
                > | >> can't eliminate fragmentation, you will have to live with process
                > | >> recycling
                > | >> or OOM's, the choice is yours.
                > | >>
                > | >> Willy.
                > | >>
                > | >>
                > | >>
                > | >>
                > | >>
                > | >> "Zen" <zen@nononospam .com> wrote in message
                > | >> news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
                > | >> | thanks for the information. By the way, I'm not clear on how the
                > | >> author
                > | >> of
                > | >> | the article came up with the 800MB as a good threshold for
                > | >> "Process\Privat e
                > | >> | Bytes"? I restructured my code to reduce memory consumption peak
                > (it's
                > | >> long
                > | >> | to explain it but it including removing a website from the server)
                > and
                > | >> it's
                > | >> | running fine even when the "Private Bytes" goes up to 1.3G. I
                > suspect
                > | >> that
                > | >> | the MEM_RESERVE regions go up for each additional website as well
                > but
                > I
                > | >> | still don't get the 800MB threshold, could someone explain? Thanks!
                > | >> |
                > | >> | Also, I was setting the memory max to 80% instead of 60% hoping to
                > | >> solve
                > | >> the
                > | >> | problem. I'm changing it back down to 65% now.
                > | >> |
                > | >> |
                > | >> | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
                > | >> | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
                > | >> | > See this info (it's long)
                > | >> | >
                > | >>
                > http://msdn.microsoft.com/library/de...nitor_perf.asp
                > | >> | >
                > | >> | > A quote:
                > | >> | > First, the likelihood of experiencing an OutOfMemoryExce ption
                > begins
                > | >> to
                > | >> | > increase dramatically when "Process\Virtua l Bytes" is within 600
                > MB
                > | >> of
                > | >> the
                > | >> | > virtual address space limit (generally 2 GB), and secondly, tests
                > | >> have
                > | >> | > shown
                > | >> | > that "Process\Virtua l Bytes" is often larger than
                > "Process\Privat e
                > | >> Bytes"
                > | >> | > by
                > | >> | > no more than 600 MB. This difference is due in part to the
                > | >> MEM_RESERVE
                > | >> | > regions maintained by the GC, allowing it to quickly commit more
                > | >> memory
                > | >> | > when
                > | >> | > needed. Taken together this implies that when "Process\Privat e
                > Bytes"
                > | >> | > exceeds
                > | >> | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
                > | >> increases.
                > | >> | >
                > | >> | > Long story short, asp.net 1.1 with has a high likelyhood of
                > | >> experiencing
                > | >> | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds 800
                > MB
                > | >> due
                > | >> to
                > | >> | > address space limitations and additional reserve by the GC.
                > | >> | >
                > | >> | > The below applies to IIS 5.0. For IIS 6.0, you would set this up
                > | >> from
                > | >> IIS
                > | >> | > Manager Properties -> Recycling -> Maximum used memory. But one
                > of
                > | >> your
                > | >> | > other posts indicated you were using Win 2k server, so you don't
                > have
                > | >> IIS
                > | >> | > 6.0.
                > | >> | >
                > | >> | > The memorylimit defaults to 60% of available RAM, which is why
                > you
                > | >> didn't
                > | >> | > have any issues while you only had 1 GB. Now that you have 2 GB,
                > | >> | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is
                > over
                > | >> the
                > | >> 800
                > | >> | > MB
                > | >> | > problem point. You'll want to set the memoryLimit in the your
                > | >> | > machine.config
                > | >> | > setting for processModel to a value that doesn't exceed 800 MB.
                > For
                > | >> a 2
                > | >> | > GB
                > | >> | > machine, 39% will do the trick.
                > | >> | >
                > | >> | > If you have enough RAM to where you have included the /3GB switch
                > to
                > | >> | > boot.ini, you can use a value that calculates out to 1,800 MB
                > | >> instead.
                > | >> | >
                > | >> | > I'd also recommend lowering the timout and idelTimout values from
                > | >> | > Infinite,
                > | >> | > to a lower value. This will allow the aspnet_wp.exe process to
                > | >> actually
                > | >> | > recycle.
                > | >> | >
                > | >> | > "Zen" wrote:
                > | >> | >
                > | >> | >> Hi,
                > | >> | >>
                > | >> | >> My production machine has 2G of memory, when aspnet_wp.exe goes
                > up
                > | >> to
                > | >> | >> about
                > | >> | >> ~1.2G of memory usage, I start get out-of-memory exception.
                > Other
                > | >> | >> processes
                > | >> | >> don't use as much memory and I added all the peak memory usage
                > of
                > | >> all
                > | >> the
                > | >> | >> processes (including aspnet_wp.exe), it goes up to no more than
                > 1.5.
                > | >> | >>
                > | >> | >> How is that possible? Would anyone know please help? thanks!
                > | >> | >>
                > | >> | >>
                > | >> | >>
                > | >> |
                > | >> |
                > | >>
                > | >>
                > | >>
                > |
                > |
                >
                >[/color]


                Comment

                • Willy Denoyette [MVP]

                  #23
                  Re: maximum .net process can use

                  GetTotalMemory( true), calls GC.Collect()/WaitForPendingF inalizers() a couple
                  of time that's right, but this is not the point, your question was about the
                  asp.net worker process right?.
                  The asp.net WP doesn't call GCGetTotalMemor y(true), and doesn't care about
                  GC allocated memory it cares about "private bytes", GC heaps are only a
                  (large) part of it. The WP will do all it can to prevent recycling, so it
                  will instruct the CLR to run a full GC, before he ever decides to recycle.
                  This is not what you should be worried about, what you should do is take
                  control over your applications memory consumption in order to prevent
                  recycling, and this starts with profiling.
                  Again, don't pay to much attention to the article unless you are running
                  v1.1 without SP1, in which case I would install the SP as soon as possible.

                  Willy.

                  "Zen" <zen@nononospam .com> wrote in message
                  news:%23AEGqsiH GHA.312@TK2MSFT NGP09.phx.gbl.. .
                  | According to the documentation that Neyah, when we pass "true" to the
                  | GetTotalMemory( ) it actually calls other methods until it "seems" nothing
                  | left to be collected (5% stability) then it returns.
                  |
                  |
                  | "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
                  | news:uFc2bNhHGH A.344@TK2MSFTNG P11.phx.gbl...
                  | > The worker process is an unmanaged host, it doesn't have to call
                  anything
                  | > to
                  | > know if the threshold has been reached, it calls the OS services (and
                  the
                  | > CLR services through the hosting interface) for this and exits when a
                  | > threshold is reached or when a deadlock is detected etc...
                  | > The aspnet ISAPI dll restarts the process when this happens.
                  | > Note also that GC.GetTotalMemo ry only returns the GC allocated memory,
                  and
                  | > that's not the threshold we are talking about.
                  | >
                  | > Willy.
                  | >
                  | >
                  | >
                  | > "Zen" <zen@nononospam .com> wrote in message
                  | > news:O53yVrgHGH A.2036@TK2MSFTN GP14.phx.gbl...
                  | > | When memoryLimit threshold is reached, does Aspnet process know to
                  call
                  | > | GC.GetTotalMemo ry(true) to ensure that it's a real violation of the
                  | > limit
                  | > | before recycling itself?
                  | > |
                  | > | thanks!
                  | > |
                  | > | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
                  | > | news:35BB8BE3-5BA9-41D1-8122-CCF988684E72@mi crosoft.com...
                  | > | >I didn't indicate that Zen should not profile the application and
                  | > attempt
                  | > | >to
                  | > | > reduce memory consumption. I merely replied to the original
                  question
                  | > of
                  | > | > "How
                  | > | > is this possible?" and directed him to an article that answered the
                  | > | > question.
                  | > | >
                  | > | > Zen, the relevant portion of the article where they indicated to use
                  | > 800
                  | > | > MB
                  | > | > is as follows:
                  | > | > First, the likelihood of experiencing an OutOfMemoryExce ption begins
                  | > to
                  | > | > increase dramatically when "Process\Virtua l Bytes" is within 600 MB
                  of
                  | > the
                  | > | > virtual address space limit (generally 2 GB), and secondly, tests
                  have
                  | > | > shown
                  | > | > that "Process\Virtua l Bytes" is often larger than "Process\Privat e
                  | > Bytes"
                  | > | > by
                  | > | > no more than 600 MB. This difference is due in part to the
                  MEM_RESERVE
                  | > | > regions maintained by the GC, allowing it to quickly commit more
                  | > memory
                  | > | > when
                  | > | > needed. Taken together this implies that when "Process\Privat e
                  Bytes"
                  | > | > exceeds
                  | > | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
                  | > increases.
                  | > | >
                  | > | > You're not really out of memory, you're just out of address space
                  for
                  | > the
                  | > | > worker process. This could be solved by utilizing the /3GB switch
                  or
                  | > | > switching to a 64 bit machine. You indicated that you don't have
                  | > enough
                  | > | > RAM
                  | > | > to use /3GB, and purchasing a new machine isn't necessarily a real
                  | > option.
                  | > | >
                  | > | > Please note that 2.0 has many optimizations to the way GC works,
                  | > including
                  | > | > the ability to reuse a fragmented LOH. You can run your 1.1 web
                  | > | > application
                  | > | > under 2.0 without having to recompile simply by going into IIS,
                  going
                  | > into
                  | > | > ASP.NET tab in the properties for the affected IIS application
                  | > directory,
                  | > | > and
                  | > | > changing the dropdown for ASP.NET Version from 1.1.4322 to
                  2.0.50727.
                  | > | >
                  | > | > If you aren't willing or aren't able to have 2.0 installed on your
                  web
                  | > | > server, I would say that your only option is to live with process
                  | > | > recycling.
                  | > | > I wouldn't consider constant OOMs with no way to recover from this
                  | > state
                  | > | > as a
                  | > | > valid "choice".
                  | > | >
                  | > | > "Willy Denoyette [MVP]" wrote:
                  | > | >
                  | > | >> Zen,
                  | > | >>
                  | > | >> You should read the article carefully, the threshold is an
                  empirical
                  | > one
                  | > | >> based on experiments using a typical application on a version
                  (v1.1)
                  | > of
                  | > | >> the
                  | > | >> framework. But it's nothing else than a (dirty) trick, it sets the
                  | > | >> threshold
                  | > | >> at such a low level that it forces the process to recycle before
                  you
                  | > | >> possibly have a chance to encounter an OOM exception, it's 'dirty'
                  | > | >> because
                  | > | >> it may hide a bug (or design flaw) in your code and it side-steps
                  the
                  | > LOH
                  | > | >> fragmentation problem typical for v1.0 and v1.1 (non SP1) of the
                  | > | >> framework.
                  | > | >>
                  | > | >> You did change your code to reduce the memory consumption, but
                  still
                  | > | >> your
                  | > | >> memory consumption reaches 1.3 GB, so I guess you did refactor your
                  | > code
                  | > | >> such that there is less (or no?) fragmentation of the LOH. But
                  again,
                  | > | >> once
                  | > | >> the heap becomes too fragmented you are at risk for OOM's. Now the
                  | > point
                  | > | >> is
                  | > | >> what do you prefer, process recycling or OOM's, for me the two are
                  | > | >> equally
                  | > | >> bad, you didn't pay for 2GB of memory to only use 60% of it didn't
                  | > you?
                  | > | >> So, I repeat it again, profile your web application take a look at
                  | > the
                  | > | >> allocation pattern, that's the only way to prevent/reduce
                  | > fragmentation
                  | > | >> in a
                  | > | >> server like application. If you can eliminate fragmentation
                  | > completely,
                  | > | >> your
                  | > | >> application will live a long, well performing and healthy life :-),
                  | > if
                  | > | >> you
                  | > | >> can't eliminate fragmentation, you will have to live with process
                  | > | >> recycling
                  | > | >> or OOM's, the choice is yours.
                  | > | >>
                  | > | >> Willy.
                  | > | >>
                  | > | >>
                  | > | >>
                  | > | >>
                  | > | >>
                  | > | >> "Zen" <zen@nononospam .com> wrote in message
                  | > | >> news:OYrZZDRHGH A.1088@tk2msftn gp13.phx.gbl...
                  | > | >> | thanks for the information. By the way, I'm not clear on how the
                  | > | >> author
                  | > | >> of
                  | > | >> | the article came up with the 800MB as a good threshold for
                  | > | >> "Process\Privat e
                  | > | >> | Bytes"? I restructured my code to reduce memory consumption peak
                  | > (it's
                  | > | >> long
                  | > | >> | to explain it but it including removing a website from the
                  server)
                  | > and
                  | > | >> it's
                  | > | >> | running fine even when the "Private Bytes" goes up to 1.3G. I
                  | > suspect
                  | > | >> that
                  | > | >> | the MEM_RESERVE regions go up for each additional website as well
                  | > but
                  | > I
                  | > | >> | still don't get the 800MB threshold, could someone explain?
                  Thanks!
                  | > | >> |
                  | > | >> | Also, I was setting the memory max to 80% instead of 60% hoping
                  to
                  | > | >> solve
                  | > | >> the
                  | > | >> | problem. I'm changing it back down to 65% now.
                  | > | >> |
                  | > | >> |
                  | > | >> | "Neyah" <Neyah@discussi ons.microsoft.c om> wrote in message
                  | > | >> | news:2A019F44-5E44-4435-8374-552A157D7B7D@mi crosoft.com...
                  | > | >> | > See this info (it's long)
                  | > | >> | >
                  | > | >>
                  | >

                  | > | >> | >
                  | > | >> | > A quote:
                  | > | >> | > First, the likelihood of experiencing an OutOfMemoryExce ption
                  | > begins
                  | > | >> to
                  | > | >> | > increase dramatically when "Process\Virtua l Bytes" is within
                  600
                  | > MB
                  | > | >> of
                  | > | >> the
                  | > | >> | > virtual address space limit (generally 2 GB), and secondly,
                  tests
                  | > | >> have
                  | > | >> | > shown
                  | > | >> | > that "Process\Virtua l Bytes" is often larger than
                  | > "Process\Privat e
                  | > | >> Bytes"
                  | > | >> | > by
                  | > | >> | > no more than 600 MB. This difference is due in part to the
                  | > | >> MEM_RESERVE
                  | > | >> | > regions maintained by the GC, allowing it to quickly commit
                  more
                  | > | >> memory
                  | > | >> | > when
                  | > | >> | > needed. Taken together this implies that when "Process\Privat e
                  | > Bytes"
                  | > | >> | > exceeds
                  | > | >> | > 800 MB, the likelihood of experiencing an OutOfMemoryExce ption
                  | > | >> increases.
                  | > | >> | >
                  | > | >> | > Long story short, asp.net 1.1 with has a high likelyhood of
                  | > | >> experiencing
                  | > | >> | > OutOfMemoryExce ptions once the aspnet_wp.exe process exceeds
                  800
                  | > MB
                  | > | >> due
                  | > | >> to
                  | > | >> | > address space limitations and additional reserve by the GC.
                  | > | >> | >
                  | > | >> | > The below applies to IIS 5.0. For IIS 6.0, you would set this
                  up
                  | > | >> from
                  | > | >> IIS
                  | > | >> | > Manager Properties -> Recycling -> Maximum used memory. But
                  one
                  | > of
                  | > | >> your
                  | > | >> | > other posts indicated you were using Win 2k server, so you
                  don't
                  | > have
                  | > | >> IIS
                  | > | >> | > 6.0.
                  | > | >> | >
                  | > | >> | > The memorylimit defaults to 60% of available RAM, which is why
                  | > you
                  | > | >> didn't
                  | > | >> | > have any issues while you only had 1 GB. Now that you have 2
                  GB,
                  | > | >> | > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is
                  | > over
                  | > | >> the
                  | > | >> 800
                  | > | >> | > MB
                  | > | >> | > problem point. You'll want to set the memoryLimit in the your
                  | > | >> | > machine.config
                  | > | >> | > setting for processModel to a value that doesn't exceed 800 MB.
                  | > For
                  | > | >> a 2
                  | > | >> | > GB
                  | > | >> | > machine, 39% will do the trick.
                  | > | >> | >
                  | > | >> | > If you have enough RAM to where you have included the /3GB
                  switch
                  | > to
                  | > | >> | > boot.ini, you can use a value that calculates out to 1,800 MB
                  | > | >> instead.
                  | > | >> | >
                  | > | >> | > I'd also recommend lowering the timout and idelTimout values
                  from
                  | > | >> | > Infinite,
                  | > | >> | > to a lower value. This will allow the aspnet_wp.exe process to
                  | > | >> actually
                  | > | >> | > recycle.
                  | > | >> | >
                  | > | >> | > "Zen" wrote:
                  | > | >> | >
                  | > | >> | >> Hi,
                  | > | >> | >>
                  | > | >> | >> My production machine has 2G of memory, when aspnet_wp.exe
                  goes
                  | > up
                  | > | >> to
                  | > | >> | >> about
                  | > | >> | >> ~1.2G of memory usage, I start get out-of-memory exception.
                  | > Other
                  | > | >> | >> processes
                  | > | >> | >> don't use as much memory and I added all the peak memory usage
                  | > of
                  | > | >> all
                  | > | >> the
                  | > | >> | >> processes (including aspnet_wp.exe), it goes up to no more
                  than
                  | > 1.5.
                  | > | >> | >>
                  | > | >> | >> How is that possible? Would anyone know please help? thanks!
                  | > | >> | >>
                  | > | >> | >>
                  | > | >> | >>
                  | > | >> |
                  | > | >> |
                  | > | >>
                  | > | >>
                  | > | >>
                  | > |
                  | > |
                  | >
                  | >
                  |
                  |


                  Comment

                  Working...