Problem: w3wp is memory bound

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

    Problem: w3wp is memory bound

    Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
    OS: Windows Server 2003 R2 Ent Edition, SP2
    Web Server: IIS 6
    ASP.NET ver: 2.0

    I made a simple ASP.NET application, with only this code in the
    Page_Load, to
    simulate a condition where huge memory is utilized by the app:

    int i = 0;
    int j = 0;
    StringBuilder[] sb = new StringBuilder[3000];

    while (i < 3000)
    {
    sb[i] = new StringBuilder(9 999999);

    j = 0;
    while (j < (9999999))
    {
    sb[i].Append('a');
    j++;
    }
    Console.WriteLi ne(i.ToString() );
    i++;
    }


    When I invoke Default.aspx from IE, the w3wp process memory use
    increases, goes
    till around 1.3 GB, and then the app crashes out with
    OutOfMemoryExce ption, w3wp
    recycles.

    In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
    Virtual memory',
    both for the App Pool. In Machine.Config, memoryLimit is set at 100%.

    I am unable to find out why the app is not going beyond 1.3 GB of
    memory usage.

    Any pointers will be helpful.

    Thanks,
    Anand
    --
  • Patrice

    #2
    Re: Problem: w3wp is memory bound

    AFAIK unless an application is explicitly written to take advantage of it, a
    single process can use 2 Gb at best plus you likely need some more memory
    during the GC (when it moves something it needs at least the source object
    and the copy).

    Note that it doesn't mean *all* requests won't use more, it means that
    *each* request won't be able to use more memory.

    Someone more knowledgable will likely popup but this is my understanding for
    now. Also knowing if you are trying to solve something or if this is just to
    see how it behaves could perhaps help...

    My first thought would be to see if you can go beyond this when issuing
    multiple queries at the same time (not sure thought what you are trying to
    find out)...

    --
    Patrice

    "Anand Saha" <anandsaha@gmai l.coma écrit dans le message de groupe de
    discussion :
    c048d8f7-12a3-415d-9928-04f89ac5c062...l egroups.com...
    Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
    OS: Windows Server 2003 R2 Ent Edition, SP2
    Web Server: IIS 6
    ASP.NET ver: 2.0
    >
    I made a simple ASP.NET application, with only this code in the
    Page_Load, to
    simulate a condition where huge memory is utilized by the app:
    >
    int i = 0;
    int j = 0;
    StringBuilder[] sb = new StringBuilder[3000];
    >
    while (i < 3000)
    {
    sb[i] = new StringBuilder(9 999999);
    >
    j = 0;
    while (j < (9999999))
    {
    sb[i].Append('a');
    j++;
    }
    Console.WriteLi ne(i.ToString() );
    i++;
    }
    >
    >
    When I invoke Default.aspx from IE, the w3wp process memory use
    increases, goes
    till around 1.3 GB, and then the app crashes out with
    OutOfMemoryExce ption, w3wp
    recycles.
    >
    In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
    Virtual memory',
    both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
    >
    I am unable to find out why the app is not going beyond 1.3 GB of
    memory usage.
    >
    Any pointers will be helpful.
    >
    Thanks,
    Anand
    --

    Comment

    • Anand Saha

      #3
      Re: Problem: w3wp is memory bound

      Patrice,

      This small experiment is to solve a bigger problem - that with Report
      Server 2005.

      We have a report which sucks huge amount of data from the database.
      And in the process of
      producing the report, the Report Server crashes with
      OutOfMemoryExce ption. .

      Its actually the w3wp which terminates when it reaches 1.3GB, and till
      now the mystery is
      still unsolved, as to why the number 1.3 ? An immediate reaction would
      be that its 60% of the
      2 GB that you mentioned, but I made sure that machine.config has 100
      in the memoryLimit parameter.

      And on further investigation, I found that this has nothing to do with
      Report Server, as a small web app
      like the one i posted shows the same behavior.

      The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
      So its frustrating that
      the process uses just 1.3 GB

      Anand
      --

      On Sep 22, 4:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
      AFAIK unless an application is explicitly written to take advantage of it, a
      single process can use 2 Gb at best plus you likely need some more memory
      during the GC (when it moves something it needs at least the source object
      and the copy).
      >
      Note that it doesn't mean *all* requests won't use more, it means that
      *each* request won't be able to use more memory.
      >
      Someone more knowledgable will likely popup but this is my understanding for
      now. Also knowing if you are trying to solve something or if this is justto
      see how it behaves could perhaps help...
      >
      My first thought would be to see if you can go beyond this when issuing
      multiple queries at the same time (not sure thought what you are trying to
      find out)...
      >
      --
      Patrice
      >
      "Anand Saha" <anands...@gmai l.coma écrit dans le message de groupe de
      discussion :
      c048d8f7-12a3-415d-9928-04f89ac5c...@b3 0g2000prf.googl egroups.com...
      >
      Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
      OS: Windows Server 2003 R2 Ent Edition, SP2
      Web Server: IIS 6
      ASP.NET ver: 2.0
      >
      I made a simple ASP.NET application, with only this code in the
      Page_Load, to
      simulate a condition where huge memory is utilized by the app:
      >
          int i = 0;
                 int j = 0;
                 StringBuilder[] sb = new StringBuilder[3000];
      >
                 while (i < 3000)
                 {
                     sb[i] = new StringBuilder(9 999999);
      >
                     j = 0;
                     while (j < (9999999))
                     {
                         sb[i].Append('a');
                         j++;
                     }
                     Console.WriteLi ne(i.ToString() );
                     i++;
                 }
      >
      When I invoke Default.aspx from IE, the w3wp process memory use
      increases, goes
      till around 1.3 GB, and then the app crashes out with
      OutOfMemoryExce ption, w3wp
      recycles.
      >
      In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
      Virtual memory',
      both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
      >
      I am unable to find out why the app is not going beyond 1.3 GB of
      memory usage.
      >
      Any pointers will be helpful.
      >
      Thanks,
      Anand
      --  

      Comment

      • Patrice

        #4
        Re: Problem: w3wp is memory bound

        Try perhaps http://support.microsoft.com/kb/909678/en-us.

        Also a quick search seems to show that RS2008 has an improved architecture
        to overcome this limit
        (http://blogs.msdn.com/bwelcker/archi...eave-iis.aspx).

        The microsoft.publi c.sqlserver.rep ortingsvcs could be better for this RS
        related issue. Good luck.

        --
        Patrice


        "Anand Saha" <anandsaha@gmai l.coma écrit dans le message de groupe de
        discussion :
        29995ed1-4b72-4dfd-a641-690d813e7e46...l egroups.com...
        Patrice,
        >
        This small experiment is to solve a bigger problem - that with Report
        Server 2005.
        >
        We have a report which sucks huge amount of data from the database.
        And in the process of
        producing the report, the Report Server crashes with
        OutOfMemoryExce ption. .
        >
        Its actually the w3wp which terminates when it reaches 1.3GB, and till
        now the mystery is
        still unsolved, as to why the number 1.3 ? An immediate reaction would
        be that its 60% of the
        2 GB that you mentioned, but I made sure that machine.config has 100
        in the memoryLimit parameter.
        >
        And on further investigation, I found that this has nothing to do with
        Report Server, as a small web app
        like the one i posted shows the same behavior.
        >
        The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
        So its frustrating that
        the process uses just 1.3 GB
        >
        Anand
        --
        >
        On Sep 22, 4:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
        >AFAIK unless an application is explicitly written to take advantage of
        >it, a
        >single process can use 2 Gb at best plus you likely need some more memory
        >during the GC (when it moves something it needs at least the source
        >object
        >and the copy).
        >>
        >Note that it doesn't mean *all* requests won't use more, it means that
        >*each* request won't be able to use more memory.
        >>
        >Someone more knowledgable will likely popup but this is my understanding
        >for
        >now. Also knowing if you are trying to solve something or if this is just
        >to
        >see how it behaves could perhaps help...
        >>
        >My first thought would be to see if you can go beyond this when issuing
        >multiple queries at the same time (not sure thought what you are trying
        >to
        >find out)...
        >>
        >--
        >Patrice
        >>
        >"Anand Saha" <anands...@gmai l.coma écrit dans le message de groupe de
        >discussion :
        >c048d8f7-12a3-415d-9928-04f89ac5c...@b3 0g2000prf.googl egroups.com...
        >>
        Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
        OS: Windows Server 2003 R2 Ent Edition, SP2
        Web Server: IIS 6
        ASP.NET ver: 2.0
        >>
        I made a simple ASP.NET application, with only this code in the
        Page_Load, to
        simulate a condition where huge memory is utilized by the app:
        >>
        int i = 0;
        int j = 0;
        StringBuilder[] sb = new StringBuilder[3000];
        >>
        while (i < 3000)
        {
        sb[i] = new StringBuilder(9 999999);
        >>
        j = 0;
        while (j < (9999999))
        {
        sb[i].Append('a');
        j++;
        }
        Console.WriteLi ne(i.ToString() );
        i++;
        }
        >>
        When I invoke Default.aspx from IE, the w3wp process memory use
        increases, goes
        till around 1.3 GB, and then the app crashes out with
        OutOfMemoryExce ption, w3wp
        recycles.
        >>
        In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
        Virtual memory',
        both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
        >>
        I am unable to find out why the app is not going beyond 1.3 GB of
        memory usage.
        >>
        Any pointers will be helpful.
        >>
        Thanks,
        Anand
        --
        >

        Comment

        • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

          #5
          Re: Problem: w3wp is memory bound

          you are confusing parameters. the max memory in the config, specifies the
          runtime max (target for GC) and a forced recycle will happen if more memory
          is used. you are getting a out-of-memory message, which is call to the o/s to
          get more memory, which is failing.

          asp.net does not support PAE (which is a memory swapping scheme requiring
          application support and used mainly for caching), so the max memory it can be
          allocated (on a 32bit o/s) is 2gb. as the process virtual page table (list
          of all pages used by a process, with necessary mapping info) goes into user
          space, a process can not actually access 2gb of memory. there is other
          control stuff in user memory, whoich lead to the max working set size (which
          can depend on which serive packs are installed). your test shows that on
          your server configuartion, 1.3 is about the max working set size.

          unless you have a lot of app pools (each which can grow to max working set
          size), 38 gb is really a waste. you should switch to a 64bit o/s to get any
          use of this memory.

          -- bruce (sqlwork.com)


          "Anand Saha" wrote:
          Patrice,
          >
          This small experiment is to solve a bigger problem - that with Report
          Server 2005.
          >
          We have a report which sucks huge amount of data from the database.
          And in the process of
          producing the report, the Report Server crashes with
          OutOfMemoryExce ption. .
          >
          Its actually the w3wp which terminates when it reaches 1.3GB, and till
          now the mystery is
          still unsolved, as to why the number 1.3 ? An immediate reaction would
          be that its 60% of the
          2 GB that you mentioned, but I made sure that machine.config has 100
          in the memoryLimit parameter.
          >
          And on further investigation, I found that this has nothing to do with
          Report Server, as a small web app
          like the one i posted shows the same behavior.
          >
          The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
          So its frustrating that
          the process uses just 1.3 GB
          >
          Anand
          --
          >
          On Sep 22, 4:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
          AFAIK unless an application is explicitly written to take advantage of it, a
          single process can use 2 Gb at best plus you likely need some more memory
          during the GC (when it moves something it needs at least the source object
          and the copy).

          Note that it doesn't mean *all* requests won't use more, it means that
          *each* request won't be able to use more memory.

          Someone more knowledgable will likely popup but this is my understanding for
          now. Also knowing if you are trying to solve something or if this is just to
          see how it behaves could perhaps help...

          My first thought would be to see if you can go beyond this when issuing
          multiple queries at the same time (not sure thought what you are trying to
          find out)...

          --
          Patrice

          "Anand Saha" <anands...@gmai l.coma écrit dans le message de groupe de
          discussion :
          c048d8f7-12a3-415d-9928-04f89ac5c...@b3 0g2000prf.googl egroups.com...
          Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
          OS: Windows Server 2003 R2 Ent Edition, SP2
          Web Server: IIS 6
          ASP.NET ver: 2.0
          I made a simple ASP.NET application, with only this code in the
          Page_Load, to
          simulate a condition where huge memory is utilized by the app:
          int i = 0;
          int j = 0;
          StringBuilder[] sb = new StringBuilder[3000];
          while (i < 3000)
          {
          sb[i] = new StringBuilder(9 999999);
          j = 0;
          while (j < (9999999))
          {
          sb[i].Append('a');
          j++;
          }
          Console.WriteLi ne(i.ToString() );
          i++;
          }
          When I invoke Default.aspx from IE, the w3wp process memory use
          increases, goes
          till around 1.3 GB, and then the app crashes out with
          OutOfMemoryExce ption, w3wp
          recycles.
          In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
          Virtual memory',
          both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
          I am unable to find out why the app is not going beyond 1.3 GB of
          memory usage.
          Any pointers will be helpful.
          Thanks,
          Anand
          --
          >
          >

          Comment

          • Anand Saha

            #6
            Re: Problem: w3wp is memory bound

            Thanks Patrice.


            On Sep 22, 7:12 pm, "Patrice" <http://www.chez.com/scribe/wrote:
            Try perhapshttp://support.microso ft.com/kb/909678/en-us.
            >
            Also a quick search seems to show that RS2008 has an improved architecture
            to overcome this limit
            (http://blogs.msdn.com/bwelcker/archi...-why-leave...).
            >
            The microsoft.publi c.sqlserver.rep ortingsvcs could be better for this RS
            related issue. Good luck.
            >
            --
            Patrice
            >
            "Anand Saha" <anands...@gmai l.coma écrit dans le message de groupe de
            discussion :
            29995ed1-4b72-4dfd-a641-690d813e7...@q2 6g2000prq.googl egroups.com...
            >
            Patrice,
            >
            This small experiment is to solve a bigger problem - that with Report
            Server 2005.
            >
            We have a report which sucks huge amount of data from the database.
            And in the process of
            producing the report, the Report Server crashes with
            OutOfMemoryExce ption. .
            >
            Its actually the w3wp which terminates when it reaches 1.3GB, and till
            now the mystery is
            still unsolved, as to why the number 1.3 ? An immediate reaction would
            be that its 60% of the
            2 GB that you mentioned, but I made sure that machine.config has 100
            in the memoryLimit parameter.
            >
            And on further investigation, I found that this has nothing to do with
            Report Server, as a small web app
            like the one i posted shows the same behavior.
            >
            The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
            So its frustrating that
            the process uses just 1.3 GB
            >
            Anand
            --
            >
            On Sep 22, 4:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
            AFAIK unless an application is explicitly written to take advantage of
            it, a
            single process can use 2 Gb at best plus you likely need some more memory
            during the GC (when it moves something it needs at least the source
            object
            and the copy).
            >
            Note that it doesn't mean *all* requests won't use more, it means that
            *each* request won't be able to use more memory.
            >
            Someone more knowledgable will likely popup but this is my understanding
            for
            now. Also knowing if you are trying to solve something or if this is just
            to
            see how it behaves could perhaps help...
            >
            My first thought would be to see if you can go beyond this when issuing
            multiple queries at the same time (not sure thought what you are trying
            to
            find out)...
            >
            --
            Patrice
            >
            "Anand Saha" <anands...@gmai l.coma écrit dans le message de groupede
            discussion :
            c048d8f7-12a3-415d-9928-04f89ac5c...@b3 0g2000prf.googl egroups.com...
            >
            Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
            OS: Windows Server 2003 R2 Ent Edition, SP2
            Web Server: IIS 6
            ASP.NET ver: 2.0
            >
            I made a simple ASP.NET application, with only this code in the
            Page_Load, to
            simulate a condition where huge memory is utilized by the app:
            >
            int i = 0;
            int j = 0;
            StringBuilder[] sb = new StringBuilder[3000];
            >
            while (i < 3000)
            {
            sb[i] = new StringBuilder(9 999999);
            >
            j = 0;
            while (j < (9999999))
            {
            sb[i].Append('a');
            j++;
            }
            Console.WriteLi ne(i.ToString() );
            i++;
            }
            >
            When I invoke Default.aspx from IE, the w3wp process memory use
            increases, goes
            till around 1.3 GB, and then the app crashes out with
            OutOfMemoryExce ption, w3wp
            recycles.
            >
            In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
            Virtual memory',
            both for the App Pool. In Machine.Config, memoryLimit is set at 100%..
            >
            I am unable to find out why the app is not going beyond 1.3 GB of
            memory usage.
            >
            Any pointers will be helpful.
            >
            Thanks,
            Anand
            --

            Comment

            • Anand Saha

              #7
              Re: Problem: w3wp is memory bound

              Thanks Bruce for the insight. We are trying out the 64 bit option,
              will report the results here.


              On Sep 22, 8:58 pm, bruce barker
              <brucebar...@di scussions.micro soft.comwrote:
              you are confusing parameters. the max memory in the config, specifies the
              runtime max (target for GC) and a forced recycle will happen if more memory
              is used. you are getting a out-of-memory message, which is call to the o/s to
              get more memory, which is failing.
              >
              asp.net does not support PAE (which is a memory swapping scheme requiring
              application support and used mainly for caching), so the max memory it can be
              allocated (on a 32bit o/s) is 2gb.  as the process virtual page table (list
              of all pages used by a process, with necessary mapping info) goes into user
              space, a process can not actually access 2gb of memory. there is other
              control stuff in user memory, whoich lead to the max working set size (which
              can depend on which serive packs are installed).  your test shows that on
              your server configuartion, 1.3 is about the max working set size.
              >
              unless you have a lot of app pools (each which can grow to max working set
              size), 38 gb is really a waste. you should switch to a 64bit o/s to get any
              use of this memory.
              >
              -- bruce (sqlwork.com)
              >
              "Anand Saha" wrote:
              Patrice,
              >
              This small experiment is to solve a bigger problem - that with Report
              Server 2005.
              >
              We have a report which sucks huge amount of data from the database.
              And in the process of
              producing the report, the Report Server crashes with
              OutOfMemoryExce ption. .
              >
              Its actually the w3wp which terminates when it reaches 1.3GB, and till
              now the mystery is
              still unsolved, as to why the number 1.3 ? An immediate reaction would
              be that its 60% of the
              2 GB that you mentioned, but I made sure that machine.config has 100
              in the memoryLimit parameter.
              >
              And on further investigation, I found that this has nothing to do with
              Report Server, as a small web app
              like the one i posted shows the same behavior.
              >
              The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
              So its frustrating that
              the process uses just 1.3 GB
              >
              Anand
              --
              >
              On Sep 22, 4:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
              AFAIK unless an application is explicitly written to take advantage of it, a
              single process can use 2 Gb at best plus you likely need some more memory
              during the GC (when it moves something it needs at least the source object
              and the copy).
              >
              Note that it doesn't mean *all* requests won't use more, it means that
              *each* request won't be able to use more memory.
              >
              Someone more knowledgable will likely popup but this is my understanding for
              now. Also knowing if you are trying to solve something or if this is just to
              see how it behaves could perhaps help...
              >
              My first thought would be to see if you can go beyond this when issuing
              multiple queries at the same time (not sure thought what you are trying to
              find out)...
              >
              --
              Patrice
              >
              "Anand Saha" <anands...@gmai l.coma écrit dans le message de groupe de
              discussion :
              c048d8f7-12a3-415d-9928-04f89ac5c...@b3 0g2000prf.googl egroups.com...
              >
              Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
              OS: Windows Server 2003 R2 Ent Edition, SP2
              Web Server: IIS 6
              ASP.NET ver: 2.0
              >
              I made a simple ASP.NET application, with only this code in the
              Page_Load, to
              simulate a condition where huge memory is utilized by the app:
              >
                  int i = 0;
                         int j = 0;
                         StringBuilder[] sb = new StringBuilder[3000];
              >
                         while (i < 3000)
                         {
                             sb[i] = new StringBuilder(9 999999);
              >
                             j = 0;
                             while (j < (9999999))
                             {
                                 sb[i].Append('a');
                                 j++;
                             }
                             Console.WriteLi ne(i.ToString() );
                             i++;
                         }
              >
              When I invoke Default.aspx from IE, the w3wp process memory use
              increases, goes
              till around 1.3 GB, and then the app crashes out with
              OutOfMemoryExce ption, w3wp
              recycles.
              >
              In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
              Virtual memory',
              both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
              >
              I am unable to find out why the app is not going beyond 1.3 GB of
              memory usage.
              >
              Any pointers will be helpful.
              >
              Thanks,
              Anand
              --  

              Comment

              Working...