Giter VIP home page Giter VIP logo

Comments (8)

krajek avatar krajek commented on May 29, 2024

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 <String, Object> dictionary that is mentioned is a local variable so currently I assume it is not a culprit of a memory leak.

from serilog.exceptions.

NizamLZ avatar NizamLZ commented on May 29, 2024

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.
I believe Destructurer reached the DB Context->Db Set or directly DB Set and started reading it, making the EF Core hit the db and get the entires.

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.

from serilog.exceptions.

krajek avatar krajek commented on May 29, 2024

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 DbContext and avoid the problem altogether.

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.

from serilog.exceptions.

RehanSaeed avatar RehanSaeed commented on May 29, 2024

Hey @NizamLZ, hope all is well.

If this is EF Core, then there is a new package to deal with it's exceptions.

from serilog.exceptions.

NizamLZ avatar NizamLZ commented on May 29, 2024

@krajek, They are sql timeout exceptions. Thanks for options A & C, will try to do one of those.
I knew B and hence updated the package to 5.2.1 very recently. This started after that itself. Never happened with old version, hence wanted to let you guys know.

Hey @RehanSaeed, all good here. Hope you are doing good as well.
Which package are you referring to?

from serilog.exceptions.

RehanSaeed avatar RehanSaeed commented on May 29, 2024

There are two packages on the home page. One for SqlException and one for EF Core exceptions.

from serilog.exceptions.

joelweiss avatar joelweiss commented on May 29, 2024

@NizamLZ

I knew B and hence updated the package to 5.2.1 very recently.

The latest package is not enough, did you add the DbUpdateExceptionDestructurer during setup?

from serilog.exceptions.

RehanSaeed avatar RehanSaeed commented on May 29, 2024

Closing. Feel free to reopen if the other packages I mentioned are not enough.

from serilog.exceptions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.