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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:30:32+00:00 2026-05-29T09:30:32+00:00

I develop a Win32 application in Visual Studio 2008 (C++). It runs fine in

  • 0

I develop a Win32 application in Visual Studio 2008 (C++). It runs fine in either 32-bit or 64-bit Windows 7. However, sometimes I need to allocate quite big memory buffers (the application deals with lots of data), and if I do it in Windows 7 64-bit, it fails, in 32-bit it runs fine. By big memory buffers I mean one ~250MB and another ~150MB. I have 8GB RAM installed in my PC, and according to my information, the 64-bit OS makes 4GB availabla for a 32-bit application. I need nowhere near that limit, still malloc fails.
Any ideas why and what can I do about it?
Thanks in advance.

  • 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-29T09:30:33+00:00Added an answer on May 29, 2026 at 9:30 am

    150MB and 250MB are not especially huge allocations. As others have noted, the problem you are hitting is most likely address space fragmentation (i.e. there is enough free space, it’s just not all in one piece).

    In addition to the other suggestions:

    • Allocate the memory as soon as the program starts. The address space will be less likely to be fragmented. If it wouldn’t be sensible to allocate this much memory for the life of the program, use VirtualAlloc with the MEM_RESERVE flag to reserve the address space and commit it later.
    • If address space is fragmented as soon as the process starts, it’s probably caused by DLLs loading at unhelpful locations. You can use VMMap to see what’s happening in the address space. If DLLs belonging to you are fragmenting the address space you can rebase them.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I install Visual C++ 2008 Express to develop code using native Win32 API. However,
i need to develop win32 GUI in c++ (plain win32 windows.h thing ) ,
We develop Win32 application that access to SQL 2005 database through Linq to SQL.
I develop desktop-based WPF-application, that uses SQL Server 2008 R2 Database and ADO.NET Entity
I develop an flex application and I need your help. The window must be
I use Visual Studio to develop unmanaged C++ apps for a living. Is there
Develop an application on Compact Framework. net 3.5 c# for Windows Mobile 6.x. In
Possible Duplicate: How do I create a native application using Visual C++ 2008? Can
i develop an java desktop application which consome sqlite database. (My pc, windows 7
I develop a c++ CGI program that runs under Windows and Linux. This program

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.