0

I am using the Boost.Interprocess library on an Intel i7 processor with Windows Embedded 7 64bit operating system. I have successfully created 2 managed shared memories about 400 Megabytes size, from 2 different processes. When I try to create a 1 Gigabyte managed shared memory from a third process, it takes more than 5 minutes. There is plenty of free space in the drive. The process gets stuck on function:

new managed_shared_memory(open_or_create, name, 1 Gigabyte);

Why is so slow? If I run this process alone, it takes less than 1 second.

yvelgl
  • 1
  • 1

1 Answers1

0

When I try to create a 1 Gigabyte managed shared memory from a third process,

Is it using another name? If not, it could be that another process holds a lock. If the other process crashed it might even have abandoned the lock in the held state. See also eg. Boost interprocess mutexes and checking for abandonment

it takes more than 5 minutes. There is plenty of free space in the drive. The process gets stuck on function: managed_shared_memory::managed_shared_memory

Shared memory is memory, not a file. If your system has too little memory to back the virtual realm, you will see a lot of swapping (is the disk very active during the wait? Then this is likely your problem).

If you wanted memory mapped files, use managed_mapped_file. No other changes required.

sehe
  • 374,641
  • 47
  • 450
  • 633