Summary: | Email::Sender::Transport::SMTP is using 10Mo of RAM | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, kyle, m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.05.00
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 28410 | ||
Attachments: |
Bug 28416: Delay load of Email::Sender::Transport::SMTP
Bug 28416: Delay load of Email::Sender::Transport::SMTP Bug 28416: Delay load of Email::Sender::Transport::SMTP |
Description
Jonathan Druart
2021-05-21 12:08:24 UTC
Created attachment 121275 [details] [review] Bug 28416: Delay load of Email::Sender::Transport::SMTP As it's taking 10M of RAM Can be tested with use Memory::Usage; my $mu = Memory::Usage->new(); $mu->record('Loading'); require Koha::Libraries; $mu->record('module loaded'); print $mu->report(); I don't think overall it's a good idea to use require, but maybe it's worth here? This one is probably especially good to do, since it looks like transport() is often called within a try/catch block anyway. (In reply to David Cook from comment #3) > This one is probably especially good to do, since it looks like transport() > is often called within a try/catch block anyway. I agree with this assertion. I'd add that we probably don't want this lib loaded on user facing places, as we are leaning towards using the message_queue more often than we do now. So, signoff? Created attachment 132028 [details] [review] Bug 28416: Delay load of Email::Sender::Transport::SMTP As it's taking 10M of RAM Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (In reply to Jonathan Druart from comment #2) > Can be tested with > > use Memory::Usage; > my $mu = Memory::Usage->new(); > $mu->record('Loading'); > require Koha::Libraries; > $mu->record('module loaded'); > print $mu->report(); > > I don't think overall it's a good idea to use require, but maybe it's worth > here? I tried moving the 'require' to the Koha::Library namespace. As we will probably load the Koha::SMTP::Server object only when we want the transport anyway. But it didn't help :-D So signing this patch as it is correct passes the QA tests and does the job. For testers: $ apt install libmemory-usage-perl E: Unable to locate package libmemory-usage-perl (In reply to Marcel de Rooy from comment #8) > E: Unable to locate package libmemory-usage-perl Resolved Created attachment 132219 [details] [review] Bug 28416: Delay load of Email::Sender::Transport::SMTP As it's taking 10M of RAM Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> (In reply to Jonathan Druart from comment #2) > I don't think overall it's a good idea to use require, but maybe it's worth > here? Dangerous precedent created ;) Pushed to master for 22.05, thanks to everybody involved [U+1F984] |