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

  • SEARCH
  • Home
  • 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 6835163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:11:58+00:00 2026-05-26T23:11:58+00:00

My application needs lots of memory and big data structure in order to perform

  • 0

My application needs lots of memory and big data structure in order to perform its work.
Often the application needs more than 1 GB of memory, and in some cases my customers really need to use the 64-bit version of the application because they have several gigabytes of memory.

In the past, I could easily explain to the user that if memory reached 1.6 to 1.7 GB of memory usage, it was ‘out of memory’ or really close to an ‘out of memory’ situation, and that they needed to reduce their memory or move to a 64-bit version.

The last year I noticed that often the application only uses about 1 GB before it already runs out of memory. After some investigations it seemed that the cause of this problem is memory fragmentation. I used VMMAP (a SysInternals utility) to look at the memory usage of my application and saw something like this:
Address Space Fragmentation

The orange areas are memory allocated by my application. The purple areas are executable code.

As you can see in the bottom halve of the image, the purple areas (which are the DLL’s) are loaded at many different addresses, causing my memory to be fragmented. This isn’t really a problem if my customer does not have a lot of data, but if my customer has data sets that take more than 1 GB, and a part of the application needs a big block of memory (e.g. 50 MB), it can result in a memory allocation failure, causing my application to crash.

Most of my data structures are STL-based and often don’t require big chunks of contiguous memory, but in some cases (e.g. very big strings), it is really needed to have a contiguous block of memory. Unfortunately, it is not always possible to change the code so that it doesn’t need such a contiguous block of memory.

The questions are:

  • How can I influence the location where DLL’s are loaded in memory, without explicitly using REBASE on all the DLL’s on the customer’s computer, or without loading all DLL’s explicitly.
  • Is there a way to specify load addresses of DLL’s in your own application manifest file?
  • Or is there a way to tell Windows (via the manifest file?) to not scatter the DLL’s around (I think this scattering is called ASLR).

Of course the best solution is one that I can influence from within my application’s manifest file, since I rely on the automatic/dynamic loading of DLL’s by Windows.

My application is a mixed mode (managed+unmanaged) application, although the major part of the application is unmanaged.

Anyone suggestions?

  • 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-26T23:11:59+00:00Added an answer on May 26, 2026 at 11:11 pm

    First, your virtual address space fragmentation should not necessarily cause the out-of-memory condition. This would be the case if your application had to allocate contiguous memory blocks of the appropriate size. Otherwise the impact of the fragmentation should be minor.

    You say most of your data is “STL-based”, but if for example you allocate a huge std::vector you’ll need a contiguous memory block.

    AFAIK there is no way to specify the preferred mapping address of the DLL upon its load. So that there are only two options: either rebase it (the DLL file), or implement DLL loading yourself (which is not trivial of course).

    Usually you don’t need to rebase the standard Windows API DLLs, they are loaded at your address space very tightly. Fragmentation may arrive from some 3rd-party DLLs (such as windows hooks, antivirus injections and etc.)

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

Sidebar

Related Questions

I have an application that loads lots of data into memory (this is because
I am developing an application that needs to perform lots of batch processing (for
I have a multithreaded server application that needs mutex locks over some shared memory.
Lots of times when I use an application that needs perforce access (Visual Studio,
my application needs multiple jars to work. Since it is a desktop application i
My application needs to provide the same data in XML to 2 different providers
In my application I have lots of different data types, e.g. Car, Bicycle, Person,
I'm considering to port an application to db4o. The data model consists of lots
I'm developing an application that needs to store lots of records in an organized
I am developing an application that needs to work on Linux, Windows and Mac

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.