Is there a solution for the problem of memory leak on .NET MF4.1 other than forcing GC to run.
Although I have forced GC to run, system fails to allocate memory of size ~2000bytes when there is ~13000 bytes available.
Thanks in advance
Is there a solution for the problem of memory leak on .NET MF4.1 other than forcing GC to run.
Although I have forced GC to run, system fails to allocate memory of size ~2000bytes when there is ~13000 bytes available.
Thanks in advance
@ enienws - Might pay to post your code to get a more informed answer.
There is no leak problem, this is fragmentation, which is normal. What product are you using?
I had been using
String[] someParsedData = someStr.Split(new char[] { ';' });
To get the data from a string. someStr is fetched from an XML file and that XML file is coming over Local Network over a TCP socket.
According to previous discussions on this forum, I have learnt that String.Split() function is somehow a cost function in frame of memory. So that I have decided to work with char[] array to process the data. So that I have implemented my own method to fetch parsed data from string. It runs correctly, but I have realized that sometimes (non-deterministically) again the system throws OutOfMemory exception. The exception is thrown on following code block:
char[] dataArr= data.ToCharArray();
I am curious about whether there is another solution for this memory fragmentation or not?
Gus,
I am using Fez Panda II and Connect Shield to connect to network.
I see, you posted under “gadgeteer” and this is what threw me off
These devices that have little memory need to be planned properly due to the very small memory. One of the things you can do is to for GC to compact the heap.
You are right but I have been already running GC to compact heap but it does not solve the problem always.