Comments (16)
The application is hosted as a windows service (using TopShelf for window service hosting, running http.sys as a web server). We do not use IIS.
The dump files you have seen above is the service running in console mode, from visual studio.
from akka.persistence.sql.
@tudorFrizeru I've taken a look at your dump file and it appears that the growth may be in/around unmanaged memory which should not typically be an issue with Akka.Persistence.Sql.
If I had to guess, I'm betting this is related to a couple of bugs in 8.0 around Native thread local storage cleanup (dotnet/runtime#95722) that won't get released till the 2024/02/13 (about a week from now). Examples of other people running into similar issues on .NET8: dotnet/runtime#96581
, dotnet/runtime#95922
Will keep digging in repo code however.
from akka.persistence.sql.
@to11mtm thank you for your quick response! I downgraded to .net 6 again and the problem remains the same.
Here's a screenshot with the managed memory allocations.
I can upload a new memory dump file if required.
from akka.persistence.sql.
@tudorFrizeru If you could that may help, there are a few other possibilities and that may narrow things down.
from akka.persistence.sql.
@to11mtm I added 2 new dump files at the same link :
- net6 Instrumentation
- net6 Memory Usage
I left them running for a long time, and they both pertain to the .net6 build
from akka.persistence.sql.
🤔
Question, is this running in IIS or via console?
from akka.persistence.sql.
@to11mtm FYI, I managed to isolate the problem to the Akka.Persistence.Sql package : I reverted back to using the Akka.persistence.SqlServer, with .net 8, and I have no memory issues anymore.
I will be happy to test again once there's a fix available!
Thank you for your support and for your great work!
from akka.persistence.sql.
@to11mtm FYI, I managed to isolate the problem to the Akka.Persistence.Sql package : I reverted back to using the Akka.persistence.SqlServer, with .net 8, and I have no memory issues anymore.
I will be happy to test again once there's a fix available! Thank you for your support and for your great work!
Thank you for that feedback!
I do have a PR up that I believe will solve some issues.
Was there anything in your app doing an EventsByTag
query with a lot of existing 'in-filter' events (i.e. Thousands to tens of thousands) present after the starting offset? One issue I found, there was a missing limit on EventsByTag
query, so cases like what I mentioned would potentially cause a lot of pressure on the Large Object Heap (Which would explain, likely quite a bit!)
from akka.persistence.sql.
@to11mtm has worked on some memory optimization improvements here around closures: #347
from akka.persistence.sql.
Hello everyone,
I encountered a similar issue and managed to resolve it in my scenario.
The problem stemmed from loading Entity Framework 8's DbContext in the constructor.
To avoid this, refrain from utilizing the DbContext property directly within the class. Instead, opt to use it within methods.
The recommended approach is to instantiate a new DbContext within each method call. You can achieve this either by creating a new instance explicitly (new DbContext()), or by retrieving it from the services (services.GetService()).
This practice ensures that each method operates with a fresh DbContext, preventing potential conflicts and ensuring better management of resources.
from akka.persistence.sql.
The problem stemmed from loading Entity Framework 8's DbContext in the constructor.
What does that have to do with this project? We use Linq2Db, not EF.
from akka.persistence.sql.
The problem stemmed from loading Entity Framework 8's DbContext in the constructor.
What does that have to do with this project? We use Linq2Db, not EF.
I think it has nothing to do with the Entity Framework, but with Net8.0 and the GC. In my case, the dbContext cache was not released by the GC as long as the class was used. In net4.8 it worked as expected. I thought there might be a similar problem with Linq2Db.
from akka.persistence.sql.
Related Issues (20)
- Journal event deletion behavior difference HOT 10
- Update Journal event deletion behavior HOT 4
- Need to reintroduce row insertion optimization
- Rebrand this repo to "Akka.Persistence.Sql" HOT 1
- Upgrade Linq2db HOT 3
- `CurrentEventsByTag` query on PostgreSql returns unordered events
- Implement WriterUuid feature
- Add CSV and TagTable unit tests for query
- Add documentation for beta release
- Make sure to add migration not supported warning in documentation
- Look into supporting DateTime and long databases
- Bump Npgsql from 6.0.7 to 7.0.2
- Csv and tag table based query configuration isn't being read consistently on all code path
- Make sure that we're using the new protobuf backed serializer HOT 3
- Update default HOCON configuration to be greenfield project friendly
- Auto initialization of tables isn't supported from the read journal side. HOT 5
- CurrentEventsByTag query on Sqlite has a weird initial delay HOT 7
- Feature: Store Tags in separate table rather than inline
- Feature Req: Create a Helper application to help users migrate away from journal_metadata
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka.persistence.sql.