Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 796731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:41:05+00:00 2026-05-14T22:41:05+00:00

I have a web site that is throwing OutOfMemoryExceptions on whenever it gets to

  • 0

I have a web site that is throwing OutOfMemoryExceptions on whenever it gets to the following spot in my code:

XmlSerializer xs = new XmlSerializer(t, xoverrides);

Seeing how this only happens when it is on the web server, i don’t have a ton of information on why this is happening. I know that the objects that it is serializing aren’t anything too serious– definitely less than a MB each.

Have you had this before? Feel like helping me diagnose the issue? Any help is appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:41:06+00:00Added an answer on May 14, 2026 at 10:41 pm

    The OutOfMemoryException is not caused by the objects being serialized, but instead it is a result of the construction of the XmlSerializer objects. When an XmlSerializer is created, an assembly is dynamically generated and loaded into the AppDomain. These assemblies cannot be garbage collected until their AppDomain is unloaded, which in your case is never. Depending on the XmlSerializer constructor being used, each and every XmlSerializer constructed will dynamically generate a new assembly. Over time, these assemblies will consume all available memory.

    There are a couple of solutions:

    1. Cache the XmlSerializer that you create.
    2. Use one of the XmlSerializer constructor overloads that implements caching. It appears that you are using XmlSerializer(Type, XmlAttributeOverrides) which does not implement caching. XmlSerializer(Type) and XmlSerializer(Type, string) implement caching.

    Microsoft KB : Memory usage is high when you create several XmlSerializer objects in ASP.NET

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site that is a customer to customer (C2C) service. Example,
I have a web site that I administer that uses Apache 2.0 on the
I have a web site in asp.net that uses a master page. In this
Let's say I have a web site for hosting community generated content that targets
I have a simple PowerShell script that uses WMI to create a web site
In my (PHP) web app, I have a part of my site that keeps
I have a web-based application that notifies users of activity on the site via
I have a site a few years old that contains about 30 aspx Web
I have a problem with a oneway web method that open a moss site
This is regarding ASP.NET MVC. Let's say I have a web site that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.