Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET out of memory troubleshooting

After reading a few enlightening articles about memory in the .NET technology, Out of Memory does not refer to physical memory, 597499.

I thought I understood why a C# app would throw an out of memory exception -- until I started experimenting with two servers-- both are having 2.5 gigs of ram, windows server 2003 and identical programs running.

The only significant difference between the two being one has 7% hard drive storage left and the other more than 50%.

The server with 7% storage space left is consistently throwing an out of memory while the other is performing consistently well.

My app is a C# web application that process' hundreds of MBs of String object.

Why would this difference happen seeing that the most likely reason for the out of memory issue is out of contiguous virtual address space.

like image 229
bushman Avatar asked Dec 09 '22 15:12

bushman


1 Answers

All I can think of is that you're exhausting the virtual memory. Sounds like you need to run a memory profiler on the app.

I've used the Red Gate profiler in similar situations in the past. You may be surprised how much memory your strings are actually using.

like image 182
chris Avatar answered Dec 27 '22 17:12

chris