On Thursday, 5 April 2018 at 20:58:32 UTC, unDEFER wrote:
100K * float[3] = 2356 Kbytes

Why not 1200 Kbytes?

My guess is the reallocation triggered by ~= just passed the double threshold there.

When the runtime appends, it usually reserves (about) 2x of what it actually needs. This is a performance optimization in most cases because it cuts down on extra allocations, copies, and fragmentation.

But if you catch it right at the edge, after it doubles but before it is filled in by more loop, it can look like excess memory.


It is also possible that you are just seeing some fixed overhead with the process.

Reply via email to