question

KumarLokesh1-0209 avatar image
0 Votes"
KumarLokesh1-0209 asked SiddharthaGoenka-5812 answered

Windows Embedded Compact 2013: OutOfMemoryException exception while reading 32kb buffer


Dear All,

I am using System.Net.Sockets APIs on Windows embedded compact 2013.

After some time i see following logs on UART.


PID:00400003 TID:04FD00CE StartGlobalCodePitch() - Starting global code pitch
PID:0484008F TID:07FB002A Thread Exception : OutOfMemoryException: at myclass.ReadNetStream()
===========
ReadNetStream is calling below Sockets API
public int Receive (byte[] buffer);
Strange thing is just before this exception, memory usage was 31% and it jumps upto 98%
===========
From:
PID:0484008F TID:069C0002 CPU load: 28% / 28% Change in heap memory: 15920184 bytes Total Memory allocated in ManagedMemory: 42711192 Total Physical Memory: 853774336 Available Phsyical Memory: 564195328 Available Virtual Memory: 903479296 Memory Used: 34% TotalPageFileMemory: 0

To:
PID:0484008F TID:00E502D2 CPU load: 22% / 26% Change in heap memory: 549657256 bytes Total Memory allocated in ManagedMemory: 583981584 Total Physical Memory: 853774336 Available Phsyical Memory: 22507520 Available Virtual Memory: 363331584 Memory Used: 98% TotalPageFileMemory: 0
===========
Also application is trying to read only 32kb of data. which should exclude memory fragmentation issues.
Can anyone explain this behavior and possible reasons for this.

Best Regards,
Lokesh K

windows-embedded
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SiddharthaGoenka-5812 avatar image
0 Votes"
SiddharthaGoenka-5812 answered

Hi @KumarLokesh1-0209

Can you please give more details on the scenario in which you are getting this exception? It will be helpful if you can provide the relevant code snippet of the app which you are running on Windows Embedded compact 2013.

Regards,
Sidd

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.