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

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Memory issues with 32-bit app

Memory issues with 32-bit app

Scheduled Pinned Locked Moved ASP.NET
asp-nethelpcsharpdesignsysadmin
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bala ram
    wrote on last edited by
    #1

    Hi all, I have an ASP.Net application developed in .Net 4.0. The web app uses around 30 .Net libraries (all custom built within our org.). These were developed about 6 years ago. We have deployed this app recently for a client under a Win 2008 R2 server. The application and all associated .dlls are compiled under 32 bit settings and we have configured the App pool to run under 32 bit too. The client started complaining of frequent out-of-memory scenarios. The application uses Session extensively to store data. We suggested increasing the server RAM from 4 gigs to 8 gigs. Despite this upgrade, the issue continues to occur. While I was researching online, I came across the design constraint that w3wp is limited to use only 2GB of addressable memory when running in 32 bit mode. (Article link) I understand that I have to compile the application and all associated libraries to run under 64 bit. Meanwhile, I was wondering if increasing the worker process count will help me resolve this issue without modifying the code base. The server has a 8-core processor, hence I could increase the worker processes to 8. I could also enable processor affinity to ensure one request is handled by one wp alone, thereby taking care of session data availability. Has anyone done something similar? Any guidance is appreciated.

    J 1 Reply Last reply
    0
    • B Bala ram

      Hi all, I have an ASP.Net application developed in .Net 4.0. The web app uses around 30 .Net libraries (all custom built within our org.). These were developed about 6 years ago. We have deployed this app recently for a client under a Win 2008 R2 server. The application and all associated .dlls are compiled under 32 bit settings and we have configured the App pool to run under 32 bit too. The client started complaining of frequent out-of-memory scenarios. The application uses Session extensively to store data. We suggested increasing the server RAM from 4 gigs to 8 gigs. Despite this upgrade, the issue continues to occur. While I was researching online, I came across the design constraint that w3wp is limited to use only 2GB of addressable memory when running in 32 bit mode. (Article link) I understand that I have to compile the application and all associated libraries to run under 64 bit. Meanwhile, I was wondering if increasing the worker process count will help me resolve this issue without modifying the code base. The server has a 8-core processor, hence I could increase the worker processes to 8. I could also enable processor affinity to ensure one request is handled by one wp alone, thereby taking care of session data availability. Has anyone done something similar? Any guidance is appreciated.

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      X86 has a 3.4 gig limit om memory X64 can go past 4 gigs. If your using lots of sessions, then the IIS web server is consuming the memory. So if your session timeout is set to lets say 72 hours, all those sessions will store for 72 hours and then clear. One thing you can do is set sessions to the sql server, I think its called inproc, to reduce memory consumption. But you really need to run task manager, and see what's consuming the memory first, is it the ? AppPool - your app. IIS Server - probably the sessions, or the IIS settings for your app. [edit] Perhaps the OS is consuming the memory? That's why we run our web servers on the server core with partial GUI. Our web servers consume about 2 to 3 gigs each, for the whole thing, and we run on X64. We have 16 gigs in them, and don't even come close to consuming all the RAM. So we have 3 web servers on each physical server, and we use about 10 gigs total. [edit2] We compile on any CPU, so it creates a 32 / 64 dll for X86 and X64 I think back in the day, the X64 only was for Intel Titanium CPU's

      B 1 Reply Last reply
      0
      • J jkirkerx

        X86 has a 3.4 gig limit om memory X64 can go past 4 gigs. If your using lots of sessions, then the IIS web server is consuming the memory. So if your session timeout is set to lets say 72 hours, all those sessions will store for 72 hours and then clear. One thing you can do is set sessions to the sql server, I think its called inproc, to reduce memory consumption. But you really need to run task manager, and see what's consuming the memory first, is it the ? AppPool - your app. IIS Server - probably the sessions, or the IIS settings for your app. [edit] Perhaps the OS is consuming the memory? That's why we run our web servers on the server core with partial GUI. Our web servers consume about 2 to 3 gigs each, for the whole thing, and we run on X64. We have 16 gigs in them, and don't even come close to consuming all the RAM. So we have 3 web servers on each physical server, and we use about 10 gigs total. [edit2] We compile on any CPU, so it creates a 32 / 64 dll for X86 and X64 I think back in the day, the X64 only was for Intel Titanium CPU's

        B Offline
        B Offline
        Bala ram
        wrote on last edited by
        #3

        We decided to run our application as a 64-bit app. We had two options to accomplish this: Option 1: Compile all component projects targeting 64bit processor. Replace all 3rd party .dlls with their 64 bit versions. Host the application under 64 bit app pool in IIS. Option 2: Compile all component projects targeting 'Any CPU'. Set the 'LargeAddressAware' option as a post build task. Replace all 3rd party .dlls with their 64 bit versions. Host the application under 64 bit app pool in IIS. The application renders correctly when we try option 1. Whereas, in option 2, the application has rendering issues. Some of the label controls are not visible in the browser and few buttons appear empty with no text in them. Any idea what could cause this wierd problem?

        J 1 Reply Last reply
        0
        • B Bala ram

          We decided to run our application as a 64-bit app. We had two options to accomplish this: Option 1: Compile all component projects targeting 64bit processor. Replace all 3rd party .dlls with their 64 bit versions. Host the application under 64 bit app pool in IIS. Option 2: Compile all component projects targeting 'Any CPU'. Set the 'LargeAddressAware' option as a post build task. Replace all 3rd party .dlls with their 64 bit versions. Host the application under 64 bit app pool in IIS. The application renders correctly when we try option 1. Whereas, in option 2, the application has rendering issues. Some of the label controls are not visible in the browser and few buttons appear empty with no text in them. Any idea what could cause this wierd problem?

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          You have to look at the HTML that is generated in the browser. So like in Firefox, you right click and inspect element. Now you see what's missing in the element, and play around with the CSS to make it visible, or perhaps the element is missing altogether now. So like in the button that's missing text, that should be a input element and the value is the text. As for fixing the code, I don't know how your generating elements. If your using webforms, or MVC Razor and so forth. I had that trouble back in 2007 when I went Any CPU, but fixed it. It was just a matter of better coding practices and proper HTML. So the fix was running the page though a HTML Validator and fixing the errors. Most of the errors were element rules, this element can't be inside that element. On the server side, I was using webforms and server side controls, so I dumped the use of properties like visible, and replace that with CSS display none; to conform more to actual HTML and CSS. You would have to post the code for the missing element, and show the HTML output from the browser. [edit] What kind of server are you running this on?, What CPU? OS

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


          • Login

          • Don't have an account? Register

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