-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory hogging happening in ReflectionBasedDestruturer #128
Comments
Hi @NizamLZ , thank you for the report and sorry for the problem. Could you tell us more about your use case? Do you have any idea how you got millions of objects in such a short time? Destructurer works only when there are exceptions, do you have that many exceptions? Could you show me what kind of exceptions are you throwing? The |
Hi @krajek, I agree, its not a leak. The stack trace showed that there was an exception(logger.log invocation), not millions, only one. The control went into Destructurer and did not come out. One thing to note is that all of the entities in memory belong to same entity type but their values are different which makes me believe that the records are read from the database rather than being the clone of the same object. I can share the dot memory workspace file (~2.5GB), It needs a system with more than 32GB of ram, to which I no longer have access and cannot look deeper into the call stack etc. by myself. |
Got it. What is the type of an exception? A) In general, if you have a problem with the particular type of exceptions you can implement custom destructurer. In your case, you would just ignore properties that reach B) #117 Lately there was an accepted PR that seems to be closely related to your problem. I didn't follow closely, but that may be helpful. C) It could be useful to use some SQL Profiler to investigate if the assumptions that DbContext started reading the whole table is correct. |
Hey @NizamLZ, hope all is well. If this is EF Core, then there is a new package to deal with it's exceptions. |
@krajek, They are sql timeout exceptions. Thanks for options A & C, will try to do one of those. Hey @RehanSaeed, all good here. Hope you are doing good as well. |
There are two packages on the home page. One for SqlException and one for EF Core exceptions. |
Closing. Feel free to reopen if the other packages I mentioned are not enough. |
Issue Description
Server memory is suddenly getting filled from 11% to 99% within ~3 mins. Came to this conclusion based on the memory dumps.
Unexpected EF Core entities found in memory.
Version
Serilog.Exceptions
NuGet package?5.3.1
The text was updated successfully, but these errors were encountered: