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 newer versions #1479

Open
ryan-adler opened this issue May 15, 2024 · 4 comments
Open

Memory leak in newer versions #1479

ryan-adler opened this issue May 15, 2024 · 4 comments

Comments

@ryan-adler
Copy link

ryan-adler commented May 15, 2024

Until recently, we were running the smtp4dev container without any issues on version linux-amd64-3.2.0-ci20221023104.
We have moved to a newer container with the latest tag (3.6.0+32d49cac3a0c67e55228cd39ca66d3b552afa7d6), and we see a constant increase in memory usage until we get OutOfMemoryExceptions.

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at Microsoft.Data.Sqlite.SqliteValueReader.GetBlob(Int32 ordinal)
   at Microsoft.Data.Sqlite.SqliteValueReader.GetFieldValue[T](Int32 ordinal)
   at lambda_method110(Closure, QueryContext, DbDataReader, ResultContext, SingleQueryResultCoordinator)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Rnwood.Smtp4dev.Controllers.MessagesController.GetSummaries(String searchTerms, String mailboxName, String sortColumn, Boolean sortIsDescending, Int32 page, Int32 pageSize) in /home/vsts/work/1/s/Rnwood.Smtp4dev/Controllers/MessagesController.cs:line 81
   at lambda_method98(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerAct

image

@rnwood
Copy link
Owner

rnwood commented May 15, 2024 via email

@ryan-adler
Copy link
Author

It is running from the container, with basically default settings, except for enabling StartTls, NumberOfMessageToKeep at 5000,, setting the hostname, port, and locking settings. So I guess the DB is using the default file mode. I would guess around 500-1000 mails is the expected volume. I can give a more accurate estimate tomorrow after our test suites have run against the old container and I can look at the history there.

@rnwood
Copy link
Owner

rnwood commented May 15, 2024

Please can you confirm if this is reproducable for you with >= 3.6.1.

I'm not able to reproduce this with 3.6.0, however the stress testing script I have and settings may not match yours. In particular, mine currently sends a large number of messages per session.

@ryan-adler
Copy link
Author

Please give us some time - we need to have the devs move tests to the new API before we can fully test. I'll let you know as soon as possible.

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

2 participants