Memory leak or am I missing an option? #434
Unanswered
brantleyp1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running into an issue trying to make a script using aiosmtpd to listen for localhost mail to forward to SES. Running on AWS instances if I send too many messages to this server script the memory grows and eventually takes down the instance. I'm testing on a t2.medium running Amazon Linux 2.
Sample code, with some logging and most of the handler_* code removed for brevity:
The issue I'm seeing is if I have this script running in a test mode that dumps the json to a log instead of SES, when loop sending messages testing volume the script quickly grows infinitely.
If I run a loop, giving a moderately sized attachment and some lorem ipsum text for a body, something like:
Looking at the VmRSS of the PID, the script initializes around 40meg of memory. If I let it run 100 iterations, it will grow to almost 2 gig of memory. But if I extend the sleep time out to 5 seconds or more, it starts at 40meg and never (at least 300 iterations) grows above 200meg.
Beta Was this translation helpful? Give feedback.
All reactions