Bugzilla – Attachment 121271 Details for
Bug 28411
Investigate memory footprint of the different dependencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28411: [DO NOT PUSH] memory_usage.pl
Bug-28411-DO-NOT-PUSH-memoryusagepl.patch (text/plain), 1.29 KB, created by
Jonathan Druart
on 2021-05-21 11:54:06 UTC
(
hide
)
Description:
Bug 28411: [DO NOT PUSH] memory_usage.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-21 11:54:06 UTC
Size:
1.29 KB
patch
obsolete
>From 8bc0a16984553cc3572f0621e0ea323bf5a0e107 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 21 May 2021 13:52:23 +0200 >Subject: [PATCH] Bug 28411: [DO NOT PUSH] memory_usage.pl > >apt install libmemory-usage-perl >cd /kohadevbox/koha >perl memory_usage.pl|sort -n >--- > memory_usage.pl | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 memory_usage.pl > >diff --git a/memory_usage.pl b/memory_usage.pl >new file mode 100644 >index 00000000000..8630e6deb44 >--- /dev/null >+++ b/memory_usage.pl >@@ -0,0 +1,31 @@ >+use Modern::Perl; >+ >+use Memory::Usage; >+use File::Slurp qw( read_file ); >+ >+my @modules = read_file('cpanfile'); >+ >+my $script = <<EOF; >+my \$mu = Memory::Usage->new(); >+\$mu->record("Loading %s"); >+require %s; >+\$mu->record("module loaded"); >+print \$mu->report(); >+EOF >+ >+$script =~ s|\n||g; >+for my $m ( @modules ) { >+ chomp $m; >+ $m =~ s|^requires '([^']*)'.*$|$1|; >+ $m =~ s|^recommends '([^']*)'.*$|$1|; >+ >+ my $cmd = sprintf $script, $m, $m; >+ my $output = qx{perl -MMemory::Usage -E '$cmd'}; >+ >+ my @report = split "\n", $output; >+ my $l = $report[2]; >+ my @x = split " ", $l; >+ my $diff_rss = $x[6]; >+ $diff_rss =~ s|\)$||; >+ say sprintf "%s - %s", $diff_rss, $m; >+} >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28411
: 121271 |
121272
|
157956
|
157957
|
158003
|
158004
|
158005
|
158006