Crazy amount of time spent on free / malloc, external memory hooks?

This is partly due to programming / debugging, partly related to the external operating system (SuperUser candidate?), But I posted it here anyway, because if someone needs to know the answer, it is here.

I developed the program when suddenly a new assembly (without any significant changes) silenced everything. I profiled it to see that it took time, but the% distribution was normal - everything went much more.

Grinding through tables with Very Sleepy, I noticed that free / malloc / delete / realloc is 95% + runtime. Suspecting a bunch of corruption, I discarded all the changes, but nothing changed.

Using the MSVC profiler, I dug up a call stack outside of malloc / realloc, and ended - surprisingly - in an external dll called Acxtrnal.dll . Here's the stack clip: http://i.imgur.com/0xXv5MV.png

Apparently, some external dlls connect to the heap checking routines of my program. This is causing me concern. Googling dll shows only one official source (something about compatibility mode does not matter): https://support.microsoft.com/en-us/kb/2272691

After spending half a day debugging in disbelief, the problem disappeared. This guy seemed to have the same problem, although the “answer” was probably unrelated: When profiling my fortran program, Acxtrnal.dll is the part that uses most of the processor time! What is this dll?

Now, of course, I am curious and worried about the problem; Will he come back - and why did this happen in the first case? I would appreciate it if someone had experienced something similar, so we can shed light on this issue. Although this problem seems rare, it might help someone out there.

+5
source share
1 answer

Thanks for the collective help. For inquiries (and googlers):

The problem is caused by the Windows failover heap: https://msdn.microsoft.com/en-us/library/windows/desktop/dd744764(v=vs.85).aspx

This is a process-specific service created on the condition that you manage to damage the heap to some unknown degree. It is not known how to deactivate the service; some say rename api dll (found in \ windows \ apppatch \ acxtrnal.dll) or disable it through the registry.

In my case, my program was a dll plugin, and I'm sure I solved the problem of placing the DLL in another program.

More information can be found in the comments, and here: http://billroper.livejournal.com/960122.html

How to disable failover heap?

+7
source

Source: https://habr.com/ru/post/1240129/


All Articles