Skip to content
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 leak in NHibernate 5.5.0 compared to 5.4.9 #712

Closed
Bogatinov opened this issue Sep 19, 2024 · 0 comments
Closed

Memory leak in NHibernate 5.5.0 compared to 5.4.9 #712

Bogatinov opened this issue Sep 19, 2024 · 0 comments

Comments

@Bogatinov
Copy link

Bogatinov commented Sep 19, 2024

Hi friends, I'm writing this issue to report a Memory leak on NHibernate objects when upgrading from v5.4.9 to v5.5.0 (and v5.5.2)

Configuration

  • dotNET Framework 4.8.1
  • NHibernate v5.4.9 and v.5.5.2
  • FluentNHibernate v3.4.0 with a binding redirect for NHibernate 5.5.0
  • AMD Ryzen 9 5950X with 32GB 3600Mhz RAM/Samsung 980 1TB
  • SQL Server 16.0.1000.6 and 15.0.4385.2 databases
  • around 270 mapping classes for tables

I haven't tested to build a custom FluentNHibernate DLL with the 5.5.2 package and see if that resolves the issue.

Story

Comparing NHibernate v5.4.9 and v5.5.0 there seem to be +200MB after 16min of usage of our app. I tested this on a Staging environment, and after 2 weeks, our testers reported that the VM was running slow.

Checked that the RAM was full with Application Insights Metrics, while the app RAM usage was around 6GB. This looked weird since +200MB is a small difference, but the more users request for SQL Server 2016/2019 data, the more this increased.

I reverted to v5.4.9 and the app stayed on around 2GB for the last 2 months.

Repository

TBD - currently setting up...

do let me know in which direction should I test it, since I'm noticing that most types with high Delta difference are part of common usages in NHibernate APIs.

Benchmarks

It's a project I can not share because of NDA reasons. The benchmark is applying automatic 10 actions in 16 min usage, by 1 user.

v5.4.9

image

v5.5.2

image

Comparison in objects

For the same benchmark test case, v5.5.2 generated 150k more objects (~15MB more)
image

than v5.4.9
image

I re-tested this in JetBrains dotMemory and received 160k - 211k on the same benchmark
image

where most types are interfaces
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant