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 7535967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:26:43+00:00 2026-05-30T06:26:43+00:00

I have a project that has a fairly complicated, nested (references calling the referenced

  • 0

I have a project that has a fairly complicated, nested (references calling the referenced objects up and down) object (class) stored in a dictionary like:

public static Dictionary<string, Object1> DObject { get; set; }

Object1 is a complicated class. It is not like a “address book” or “person info” class. The class itself has arrays, dictionaries of another object. Those object references class above it, etc.

Because the size of the DObject can be 1GB+ in memory, I’m going to serialize it to a file using BinaryFormatter. Because I need to load this object, I was thinking of using MemoryMappedFile. New keys and values might be added to the dictionary. Objects might have more data in them (added/updated), etc. Does the MMF change size? How do I access a certain key in the DObject in the memory mapped file? Is there a searching mechanism like a hashtable in memory so I can find a certain key like a dictionary and get its value? How is this MMF work anyway?

My ideal thought is. Have a large file on disk (2GB+). I update the object in the dictionary fast on the disk like having a memory saved on the disk. Everything is fast. Key-value look up all the way. I look up, edit the value, save, etc… I would have to have quick access to this 2GB+ object any time I want. If the WCF server restarts, I would need quick access to this 2GB+ size object. That’s why I was thinking 1) serialization 2). load and read from/to MMF. My main concern is speed at this moment. I can’t be reloading this 2GB data from scratch everytime I debug the project in other words (it takes long time).

Any suggestions, ideas and thoughts on how I should handle this situation.

  • 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-30T06:26:44+00:00Added an answer on May 30, 2026 at 6:26 am

    You can’t keep DObject itself in a memory mapped file. .NET objects tend to move around all the time, and you can’t force them to stay in one place in memory (you could pin them, but you really don’t want to). You can serialize the object and write it to file, but that would mean writing more than 1GB of data each time.

    Why not go the standard way, and ‘serialize’ your object to a set of database tables?

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

Sidebar

Related Questions

I have inherited a project that has class libraries written in VB.NET, some of
I have a project that has a makefile with broken dependencies. Is there any
I have a project that has the following line in the additional includes section:
I have a project that has a revision number of 3960. But unfortunately it
I have a project that has several build configurations (FREE version, male-only, female-only, etc.).
I have a project that has a GUI (written in QT) and a command-line
I have a .net project that has a web reference to a service. I
We have a netbeans project that has an xsd that we use to create
I have a maven project that has a set of library dependancies that are
We have a sub-project 'commonUtils' that has many generic code-snippets used across the parent

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.