A
A
Alexey2016-01-06 12:29:18
.NET
Alexey, 2016-01-06 12:29:18

Unmanaged memory allocation in .NET, is it worth it?

Should you allocate memory in unmanaged memory when creating a large object pool? On the one hand, this is better for the garbage collector, because no need to label and clean up a bunch of large objects, but on the other hand, when loading from unmanaged memory, you need to constantly convert to managed objects. And serialization and deserialization every time, if you work through streams using UnmanagetMemoryStream and UnmanagedMemoryAccessor.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-01-06
@petermzg

So make tests and see in which case your algorithm works faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question