Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

error : unable to obtain mapped memory (see pch_diag.txt)

Ian_Mallett1
Beginner
4,547 Views

Hi,

After updating to Version 2016.3.207 (Intel Compiler 16.0 Update 3), I am now getting errors like the following all over the place:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1320): error : unable to obtain mapped memory (see pch_diag.txt)
    		typename enable_if<_Is_iterator<_Iter>::value,
    		                   ^
            detected during instantiation of class "std::vector<_Ty, _Alloc> [with _Ty=glLib::Texturing::Texture2D *, _Alloc=std::allocator<glLib::Texturing::Texture2D *>]" at line 37 of "C:\dev\C++\Libraries\gllib\gllib\gllib/effects/imagespace/depth_peel.h"

The only related info comes from an ancient thread which proclaimed it fixed.

Thanks,

0 Kudos
23 Replies
hills__adrian
Beginner
444 Views

This problem ("unable to obtain mapped memory" when using/creating a pre-compiled header) STILL OCCURS in the latest 19.0.xxx release. As others have said, it really is a dreadful fault in the package, especially for folks who've paid lots of $$$ for this product, only to discover their projects/solutions take a huge amount of time to compile (without PCH usage).

0 Kudos
jimdempseyatthecove
Honored Contributor III
444 Views

Using Intel C++ 19.0 update 2, compiling an old project (formerly Intel C++ 17) has encountered this error.

This project has conditional compilation directives to use or not use TBB.

x64 Debug build

When compiled without TBB and without PCH the project builds
When compiled without TBB and with PCH the project errors out with the "unable to obtain mapped memory"
When compiled with TBB and without PCH the project errors out with the "unable to obtain mapped memory"
When compiled with TBB and without PCH the project errors out with the "unable to obtain mapped memory"

The error on my system occurs with:

3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xxatomic(633): error : unable to obtain mapped memory (see pch_diag.txt)
3>    	_ATOMIC_UINT _Temp = (_ATOMIC_UINT)*_Exp;

Visual C++ 2013   06177-179-0128451-02371
Microsoft Visual C++ 2013

I haven't decided to purchase MS VS 2017 due to MS VS 2019 in the process of being released.

Jim Dempsey

0 Kudos
trump__jenny
Beginner
444 Views

As stated on msdn OpenFileMapping is defined as

HANDLE WINAPI OpenFileMapping( _In_ DWORD dwDesiredAccess, _In_ BOOL bInheritHandle, _In_ LPCTSTR lpName );

So when you call bInheritHandle with FALSE, the handle isn't shared with other processes. Try TRUE, just like you did in C# with System.IO.HandleInheritability.Inheritable.

ipcBufferHandle = OpenFileMapping(FILE_MAP_READ, TRUE, myFileName);

0 Kudos
Reply