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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -