none
C++ AMP Memory Leak RRS feed

  • Question

  • The following application code:

    #ifdef _DEBUG
    	int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
    	flag |= _CRTDBG_LEAK_CHECK_DF;
    	_CrtSetDbgFlag(flag);
    	//_CrtSetBreakAlloc(837); 
    #endif
    
    	for (int i = 0; i < 10; i++)
    	{
    		extent<1> e(10);
    		parallel_for_each(e, [=](index<1> idx) restrict(amp) { });
    	}

    reveals that there is a memory leak in C++ AMP.

    C++ AMP Memory Leak Detected

    Uncommenting "//_CrtSetBreakAlloc(837);" and running the application again reveals the origin of the memory leak:

    Memory Leak Origin

    I wonder when this leak was introduced, as I don't seem to have had problems with memory leakd when using C++ AMP 6-9 months ago.

    This seems to be a quite serious issue.

    I have tested on two different machines, with differing hardware with memory leaks appearing on both. Can anyone reproduce this? I'm using Visual Studio 2012 (Update 2).

    Tuesday, April 16, 2013 6:56 AM

All replies