I am working on retrofitting an application written in VB.NET. It is a simple program that uses 0.5GB (!) of RAM, because of a large amount (30+) of globally defined arrays, like:
Public Temp(1000000) As Double
Public ThisIsAnotherVariable(5000, 10) As String
Public ThisIsAVeryLargeArray(64, 50000) As Double
Most of the time, these large "buffers" are barely used, so I would like to convert them to use something from Collections.Generic. Is there any semi-transparent way to convert these? Or a bit of trickery to get the CLR to only allocate the used segments?