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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:19:32+00:00 2026-06-13T02:19:32+00:00

Is it possible to create a memory pool shared between processes (for example from

  • 0

Is it possible to create a memory pool shared between processes (for example from CreateFileMapping with INVALID_HANDLE_VALUE in Win32) and then use that chunk of memory as a heap ?

I would like the new/delete operators (or malloc/free) to allocate/free memory from that chunk (and do their usual heap management on it).

Thanks.

EDIT: My real problem is simple: for now I use the new operator to allocate various large series of structures normally, but I want these structures to persist after the process closes. So I would like to create another process whose almost only function is to hold the memory when the main process closes.

For that, I would create a chunk of shared memory with CreateFileMapping in the auxiliary process, and, in the main process, tell those new/delete used to allocate the structures to use that chunk instead of the process’s heap.

To recover the structures after the main processes is relaunched, I would add a fixed amount to all the pointers, reflecting the different origins of the mapped view returned by MapViewOfFile.

  • 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-06-13T02:19:34+00:00Added an answer on June 13, 2026 at 2:19 am

    Thanks to the people who commented.

    Answering my own question:

    I gave up on making the shared memory a heap, I simply save a fixed snapshot of the structures to the shared memory allocated by the other process with CreateFileMapping. I just do the opposite when the process is relaunched, using OpenFileMapping and MapViewOfFile.

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

Sidebar

Related Questions

Is it possible to create an app that will copy image files from a
Is it possible somehow to create in-memory database in SQLite and then destroy it
It's possible to create lots of memory-intensive objects and then abandon references to them.
Possible Duplicate: Create new C++ object at specific memory address? I am writing what
Is it possible to create a class instance on Application_Start that can be used
Is it possible to create a modifiable string literal in C++? For example: char*
I have a Tomcat Application Server that is configured to create a memory dump
Is it possible to create a memory mapped file for interprocess communication with a
Inspired from this question , was wondering what are the possible ways to create
Is it possible to create a hidden UIWebView programmatically and then release it(destroy it

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.