Why does cost to access unmanaged memory in C# occasionally reach 120ms? -
Why does cost to access unmanaged memory in C# occasionally reach 120ms? -
i utilize marshal.allochglobal allocate several huge chunks (100mb each) of unmanaged memory in c# application (in windows). utilize these allocate smaller pieces of unmanaged memory. after benchmarking these smaller allocations, recognized while on 99% of them cost 0-10 c# stopwatch ticks, cost 30ms 120ms , chase cost downwards individual memset calls (of 150 bytes). replaced memset phone call 2 memory writes addresses in memory area memset touch , observed same cost. means have memory accesses cost several 1000 times more cost of main memory access. page faults seem have similar cost, wondering if page faults cause behavior, looking @ windows task manager, far main memory capacity when problem occurs.
i tried reproduce in microbenchmarks without success. have clue cause behavior or chase down?
c# memory memory-management page-fault unmanaged-memory
Comments
Post a Comment