Memory exception

I am working on a web application using C # and asp.net. I am getting a memory exception. What the application does is a bunch of records (products) from a data source, it can be hundreds / thousands, processes these records using the parameters in the wizard, and then updates another data source with information about the process products. Although there are several DB classes, now all the logic is in one large class. The only reason for this is that all information is related to one thing, a product. Would memory help me if I split my application into different classes? I don’t think it would be because if I divided the business logic into two classes, both classes remained alive all the time sending messages to each other, and therefore I don’t know how this would help. I suppose my other solution would be to find outwhat to suck all memory. Is there a good tool you could recommend?

thanks

+3
source share
6 answers

Do you use datareaders to transfer your data? (so as not to load too much into memory)

My gut tells me that this is a trivial problem to fix, do not pump data with 1 million records, work through tables one row at a time or in small batches ... Release and destroy objects when you are done with them. (Example: does not static List<Customer> allCustomers = AllCustomers())
You have a design rule that ensures that no one reads tables in memory if more than X rows participate in them.

.NET memory profiler windbg sos, .

: , SuperDuperDoEverything , . SuperDuperDoEverything - , .

+10

, . , , .NET , , OOM - .

- Perfmon, WinDBG. adplus - , adplus -crash -iis. , - :

.symfix C:\symbols
.reload
.loadby sos mscorwks
!dumpheap -stat

, .

, , , , " XML-" .

, VS Team Edition , . . , .

, , . ++, , , , Garbage, , .

+6
+3

. , , , .

+3

Perfmon; , GC. , ( GC ), , , .

+1

, .

? , / , /? .

, .

+1

Source: https://habr.com/ru/post/1702614/


All Articles