fhem / fhem-docker

A basic Docker image for FHEM house automation system, based on Debian Linux.
https://fhem.de/
MIT License
85 stars 27 forks source link

Memory leak with Perl 5.32 #152

Closed flobiwan closed 6 months ago

flobiwan commented 6 months ago

I migrated my fhem installation from an old desktop pc (Debian buster with perl 5.28.1) to the current docker image with perl 5.32 and ran into the perl memory leakage described here: https://forum.fhem.de/index.php/topic,112649.msg1069721.html#msg1069721

I need to restart ~ every 60h to prevent my fhem instance to crash.

Accourding to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994834#10 the bug is fixed with perl version 5.34.0.1 . An imminent release of a new image based on Debian Bookworm would solve the problem, since this release uses Perl 5.36.0-7+deb12u.

sidey79 commented 6 months ago

Thanks for the Info, i'll look for a solution

sidey79 commented 6 months ago

I try to switch to the perl Image, as the base image, because it is easier to change to a updated perl version with this base.

But this needs some time, migrating the installation method from perl deb packages to cpan.

sidey79 commented 6 months ago

I've created a new image, with an updated perl version.

ghcr.io/fhem/fhem-docker:4.0.0-beta1-bullseye

I haven't tested is much and i want to change a few things, but a first feedback from your side would be nice.

Here is the list of included perl packages which should cover anything, which FHEM may try to load:

Algorithm::DecisionTree | 3.430
Algorithm::Diff | 1.201
Alien::Base::ModuleBuild | 1.170
Alien::Build | 2.800
Alien::Build::Plugin::Download::GitLab | 0.010
Alien::Libxml2 | 0.190
Alien::Sodium | 1.000008000
AnyEvent | 7.170
App::cpanminus | 1.704700
Archive::Extract | 0.880
Archive::Zip | 1.680
ARGV::Struct | 0.060
Array::RefElem | 1.000
Authen::OATH | 2.000001
Authen::SASL | 2.170000
B::Hooks::EndOfScope | 0.260
B::Hooks::OP::Check | 0.220
B::Keywords | 1.260
bareword::filehandles | 0.007
Bit::Vector | 7.400
Cache::Cache | 1.080
Call::Context | 0.030
Canary::Stability | 2013.000
Capture::Tiny | 0.480
Carp::Assert | 0.220
Carp::Clan | 6.080
CGI | 4.610
CGI::Session | 4.480
CHI | 0.610
CHI::Driver::Redis | 0.100
Class::Accessor | 0.510
Class::Data::Inheritable | 0.090
Class::Inner | 0.200001
Class::Inspector | 1.360
Class::Load | 0.250
Class::Load::XS | 0.100
Class::Loader | 2.030
Class::Method::Modifiers | 2.150
Class::Singleton | 1.600
Class::Tiny | 1.008
Clone | 0.460
common::sense | 3.750
Config::AWS | 0.120
Config::Tiny | 2.300
Convert::Base32 | 0.060
Coro | 6.570
CPAN::Common::Index | 0.010
CPAN::DistnameInfo | 0.120
Cpanel::JSON::XS | 4.370
Crypt::Argon2 | 0.020
Crypt::CBC | 3.040
Crypt::ECB | 2.230
Crypt::MySQL | 0.040
Crypt::NaCl::Sodium | 1.000008000
Crypt::OpenSSL::AES | 0.190
Crypt::OpenSSL::Guess | 0.150
Crypt::PBKDF2 | 0.161520
Crypt::Random | 1.540
Crypt::RC4 | 2.020
Crypt::Rijndael | 1.160
Crypt::Rijndael_PP | 0.050
Crypt::URandom | 0.390
CryptX | 0.080
Data::Compare | 1.290
Data::Dump | 1.250
Data::OptList | 0.114
Data::Perl | 0.002011
Data::UUID | 1.226
Data::Visitor | 0.320
DataStruct::Flat | 0.010
Date::Parse | 2.330
DateTime | 1.650
DateTime::Event::Sunrise | 0.050600
DateTime::Format::Builder | 0.830
DateTime::Format::ISO8601 | 0.160
DateTime::Format::Strptime | 1.790
DateTime::Locale | 1.400
DateTime::Set | 0.390000
DateTime::TimeZone | 2.620
DBI | 1.643
Devel::GlobalDestruction | 0.140
Devel::OverloadInfo | 0.007
Devel::Size | 0.830
Devel::Size::Report | 0.130
Devel::StackTrace | 2.050
Devel::Symdump | 2.180
Device::Firmata | 0.690
Device::SerialPort | 1.040
Device::SMBus | 1.150
Device::USB | 0.380
Digest::CMAC | 0.040
Digest::CRC | 0.240
Digest::HMAC | 1.040
Digest::JHash | 0.100
Digest::Perl::MD5 | 1.900
Digest::SHA1 | 2.130
Digest::SHA3 | 1.050
Dist::CheckConflicts | 0.110
Email::Date::Format | 1.008
Encode::Detect | 1.010
Encode::Locale | 1.050
Error | 0.170290
Eval::Closure | 0.140
Exception::Class | 1.450
Expect | 1.350
Exporter::Tiny | 1.006002
ExtUtils::Config | 0.008
ExtUtils::Depends | 0.800100
ExtUtils::Helpers | 0.026
ExtUtils::InstallPaths | 0.012
ExtUtils::MakeMaker::CPANfile | 0.090
FFI::CheckLib | 0.310
File::BaseDir | 0.090
File::chdir | 0.101100
File::Copy::Recursive | 0.450
File::DesktopEntry | 0.220
File::Find::Rule | 0.340
File::HomeDir | 1.006
File::Listing | 6.160
File::MimeInfo | 0.340
File::Path::Expand | 1.020
File::ShareDir | 1.118
File::ShareDir::Install | 0.140
File::Slurp | 9999.320
File::Which | 1.270
Finance::Quote | 1.590
Future | 0.500
Future::Mojo | 1.002
Getopt::Long | 2.570
Getopt::Long::Descriptive | 0.114
Getopt::Simple | 1.520
GnuPG::Interface | 1.040
Guard | 1.023
Hash::MoreUtils | 0.060
HTML-TableExtract | ?
HTML::Parser | 3.810
HTML::Selector::XPath | 0.280
HTML::Tagset | 3.200
HTML::TokeParser::Simple | 3.160
HTML::Tree | 5.070
HTML::TreeBuilder::XPath | 0.140
HTTP::CookieJar | 0.014
HTTP::Cookies | 6.110
HTTP::Daemon | 6.160
HTTP::Date | 6.060
HTTP::Message | 6.450
HTTP::Negotiate | 6.010
Image::ExifTool | 12.760
Image::Imlib2 | 2.030
Image::Info | 1.440
Image::LibRSVG | 0.070
Image::Size | 3.300
Imager | 1.023
Import::Into | 1.002005
indirect | 0.390
Inline | 0.860
Inline::C | 0.820
Inline::Python | 0.570
IO::Framed | 0.160
IO::HTML | 1.004
IO::Interface | 1.090
IO::SessionData | 1.030
IO::SigGuard | 0.150
IO::Socket::INET6 | 2.730
IO::Socket::Multicast | 1.120
IO::Socket::Multicast6 | 0.030
IO::Socket::SSL | 2.085
IO::Socket::Timeout | 0.320
IO::String | 1.080
IO::Stringy | 2.113
IO::Tty | 1.200
IPC::System::Simple | 1.300
JSON | 4.100
JSON::Any | 1.400
JSON::MaybeXS | 1.004005
libxml-perl | ?
Lingua::EN::Inflect | 1.905
Linux::Inotify2 | 2.300
Linux::Input | 1.030
Lirc::Client | 2.020
List::MoreUtils | 0.430
List::MoreUtils::XS | 0.430
List::SomeUtils | 0.590
List::SomeUtils::XS | 0.580
Log::Any | 1.717
LWP | 6.760
LWP::MediaTypes | 6.040
LWP::Online | 1.080
LWP::Protocol::https | 6.130
Mail::GnuPG | 0.230
Mail::IMAPClient | 3.430
MailTools | 2.210
Math::ConvexHull | 1.040
Math::Expression::Evaluator | 0.003002
Math::Pari | 2.030523
Math::Polygon | 1.100
Math::Random | 0.720
Math::Round | 0.080
MCE | 1.889
MIME::Base64::URLSafe | 0.010
MIME::Lite | 3.033
MIME::Tools | 5.514
MIME::Types | 2.260
Mock::Sub | 1.090
Module::Build | 0.423400
Module::Build::Tiny | 0.047
Module::CPANfile | 1.100400
Module::Find | 0.160
Module::Implementation | 0.090
Module::Pluggable | 5.200
Module::Runtime | 0.016
Module::Runtime::Conflicts | 0.003
Mojolicious | 9.350
Moo | 2.005005
Moose | 2.220700
MooseX::ClassAttribute | 0.290
MooseX::Getopt | 0.760
MooseX::Role::Parameterized | 1.110
MooX | 0.101
MooX::HandlesVia | 0.001009
MooX::late | 0.100
MooX::Types::MooseLike | 0.290
MooX::Types::MooseLike::Numeric | 1.030
Mozilla::CA | 20231213.000
MRO::Compat | 0.150
multidimensional | 0.014
namespace::autoclean | 0.290
namespace::clean | 0.270
Net::Address::IP::Local | 0.001002
Net::Amazon::Signature::V4 | 0.210
Net::Bonjour | 0.960
Net::DNS | 1.440
Net::FTPSSL | 0.420
Net::HTTP | 6.230
Net::Jabber | 2.000
Net::MQTT | ?
Net::MQTT::Simple | 1.290
Net::OAuth | 0.280
Net::OpenSSH | 0.840
Net::Rackspace::CloudFies | ?
Net::SIP | 0.836
Net::SMTP::SSL | 1.040
Net::SNMP | 6.000001
Net::SSLeay | 1.940
Net::Telnet | 3.050
Net::Twitter | 4.010430
Net::UPnP | 1.004006
Net::WebSocket::Server | 0.004000
Net::XMPP | 1.050
Nmap::Parser | 1.370
Number::Compare | 0.030
OLE::Storage_Lite | 0.220
Package::DeprecationManager | 0.180
Package::Stash | 0.400
Package::Stash::XS | 0.300
Params::Util | 1.102
Params::Validate | 1.310
Params::ValidationCompiler | 0.310
Parse::Distname | 0.050
Parse::RecDescent | 1.967015
Path::Tiny | 0.144
Paws | 0.460
Pegex | 0.750
Perl | 5.036003
Perl::Critic | 1.152
Perl::PrereqScanner::NotQuiteLite | 0.991700
Perl::Tidy | 20240202.000
PerlIO::via::Timeout | 0.320
Pod::Parser | 1.670
Pod::Spell | 1.260
PPI | 1.277
PPIx::QuoteLike | 0.023
PPIx::Regexp | 0.088
PPIx::Utils | 0.003
Promise::ES6 | 0.280
Protocol::DBus | 0.220
Protocol::WebSocket | 0.260
Readonly | 2.050
Redis | 2.000
Ref::Util | 0.204
Ref::Util::XS | 0.117
Regexp::Trie | 0.020
RiveScript | 2.000004
Role::Hooks | 0.008
Role::Tiny | 2.002004
RPC::XML | 1.610
Set::Infinite | 0.650
Shell::Config::Generate | 0.340
Shell::Guess | 0.090
SOAP::Lite | 1.270
Socket6 | 0.290
Socket::Multicast6 | 0.040
Sort::Versions | 1.620
Specio | 0.480
Spiffy | 0.460
Spreadsheet::ParseExcel | 0.660
Spreadsheet::XLSX | 0.170
Statistics::ChiSquare | 1.000000
strictures | 2.000006
String::CRC32 | 2.100
String::Format | 1.180
String::RewritePrefix | 0.009
String::Util | 1.340
Sub::Exporter | 0.991
Sub::Exporter::Progressive | 0.001013
Sub::HandlesVia | 0.050000
Sub::Identify | 0.140
Sub::Install | 0.929
Sub::Override | 0.100
Sub::Quote | 2.006008
Sub::Uplevel | 0.280000
SUPER | 1.201905310
Switch | 2.170
Sys::Mmap | 0.200
Sys::Statistics::Linux | 0.660
Task::Weaken | 1.060
Term::Table | 0.018
Test2::Suite | 0.000159
Test::Base | 0.890
Test::CheckManifest | 1.430
Test::Class | 0.520
Test::Deep | 1.204
Test::Deep::UnorderedPairs | 0.006
Test::Device::SerialPort | 0.050
Test::Differences | 0.710
Test::Exception | 0.430
Test::Fatal | 0.017
Test::JSON | 0.110
Test::Mock::Redis | 0.220
Test::MockModule | 0.177000
Test::Perl::Critic | 1.040
Test::Pod | 1.520
Test::Requires | 0.110
Test::SharedFork | 0.350
Test::TCP | 2.220
Test::Unit | 0.250
Test::Warn | 0.370
Test::Without::Module | 0.210
Text::CSV | 2.040
Text::Diff | 1.450
Text::Glob | 0.110
Text::Iconv | 1.700
Text::Template | 1.610
Text::Unaccent | 1.080
Throwable | 1.001
Tie::Handle::Offset | 0.004
Tie::ToObject | 0.030
Time::Duration | 1.210
Time::Duration::Parse | 0.160
Try::Tiny | 0.310
Type::Tiny | 2.004000
UNIVERSAL::require | 0.190
URI | 5.270
URI::Template | 0.240
URL::Encode | 0.030
URL::Encode::XS | 0.030
Variable::Magic | 0.630
Web::Scraper | 0.380
WWW::Jawbone::Up | 1.032004
WWW::RobotRules | 6.020
X::Tiny | 0.220
XML::Bare | 0.530
XML::DOM | 1.460
XML::LibXML | 2.021000
XML::LibXSLT | 2.002001
XML::NamespaceSupport | 1.120
XML::Parser | 2.470
XML::Parser::Lite | 0.722
XML::RegExp | 0.040
XML::SAX | 1.020
XML::SAX::Base | 1.090
XML::SAX::Expat | 0.510
XML::Simple | 2.250
XML::Stream | 1.240
XML::Twig | 3.520
XML::XPath | 1.480
XML::XPathEngine | 0.140
XML::XSLT | 0.480
XString | 0.005
XXX | 0.380
YAML | 1.310
YAML::PP | 0.038000
YAML::Tiny | 1.740
sidey79 commented 6 months ago

@flobiwan

I hope, things are going well.

Have you tested the image and any feedback for me?

flobiwan commented 6 months ago

Hi, I think that solved it. I tried it for about 2 weeks now and so far I did not notice a running full of memory. Thank you