Skip to content
Advertisement

Heap allocation and suitable hardware

For a C# .net 3.5 application which unavoidably creates a lot of data on the heap, in terms of hardware what would I be looking for in terms of memory? Would it just be the largest socket bus width? Or the “bandwidth” of the memory sticks? Or the actual frequency they run at?

We have concluded the bottleneck of our application cannot be avoided and when scaling up, spreading the work over multiple threads we seem to be getting “collisions” due to many threads accessing the RAM.

The actual problem refers to locking on items and having many threads trying to access these items. There is no way to further optimise the threading locking. As this relates to threading I wasn’t sure whether I should also investigate alternative CPU choices and also closely look at the QPI statistics? We are currently using the Westmere architecture but a slow clock speed of 2GHz.

EDIT: Has been suggested DMA is what could help us.

I’m going to tag this as C# and Java, because I believe the answer will not be C#-specific.

Thanks in advance,

Advertisement

Answer

I would test the application on a faster machine. From the sounds of it, your memory bandwidth is the bottle neck, so I would try a 4.5 GHz over clocked i7 with 32 GB of 1600 MHz memory or similar. You can buy one for about $1000. You may find that with a much faster system your bottle neck moves.

BTW: I doubt that object creation in C# is avoidable, though it might be not achieveable as it sounds like to have limited time to fix this. In Java, I have written a number of high performance servers which GCes less than once per day, but you have to write all the core code with objective. Similarly you can write a service which does not lock in critical sections of code, but its not trival to just add this later.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement