I've been trying to get a piece of code working to reallocate a huge unmanaged matrix structure (namely std::vector<std::vector<T> >
) to an equivalent managed structure( cli::array<T,2>
). As I can't hold both structures in memory at once I opted to write to a file and read the structure back. The problem is that once I delete the original matrix, and hence the memory trying to allocate managed memory for the matrix fails.
I image this might have something to do with the heaps of different runtimes cpp vs clr. But can't find any specific details. Is it possible that the cpp runtime is keeping heap space, that prevents clr heap to allocate matrix back? If so, is it possible to force the cpp runtime to clean heap space in order to make room for the clr heap.
Now just to clarify, the destination matrix has to be a bidimensional array, not a jagged array. I know this has the problem that can't be resized. Otherwise I might be able to move the matrix by smaller chunks.
Thanks, in advance.