aMule Forum

English => aMule crashes => Topic started by: Impactor on November 24, 2009, 11:09:35 AM

Title: aMule is taking 16GB of RAM
Post by: Impactor on November 24, 2009, 11:09:35 AM
Well, only 4gb, cause that’s all I have, but it would use everything no matter how much I had.

Every time it loses the connection, it starts expanding in RAM until computer is no longer usable.
I am looking either for:
1. A way to make aMule stop doing that
2. A script that will kill it when it reaches 50% of memory
Title: Re: aMule is taking 16GB of RAM
Post by: Stu Redman on November 24, 2009, 11:11:05 AM
Version? Platform? Logfile?
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 24, 2009, 11:12:49 AM
Version? Platform? Logfile?
aMule 2.2.6.
Ubuntu 64bit
I dont have a logfile with crash right now, but I doubt there would be anuthing other than "Cannot connect to server".
Title: Re: aMule is taking 16GB of RAM
Post by: Stu Redman on November 24, 2009, 02:23:33 PM
Distro or self-compiled? Which Ubuntu version?
Please post the log file when it happens again. (Remove references to file real names first.)
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 24, 2009, 02:35:18 PM
It is Ubuntu Jaunty 9.04 64bit. Customized but none of the changes touches amule.
I will post the log when it happens, but in the mean time could you speculate? I take it that's not a common problem?
Title: Re: aMule is taking 16GB of RAM
Post by: Stu Redman on November 24, 2009, 05:10:32 PM
It's not common, unless you have an upload speed of > 1MB / s or so.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 24, 2009, 05:18:39 PM
Not really. My upload is capped at 100kb/s. As I said, however, it only happens then there is no internet connection for few mintues. Then, memory leak starts and after 5-10 minutes it takesover 4gb of ram.
Title: Re: aMule is taking 16GB of RAM
Post by: Stu Redman on November 24, 2009, 10:46:40 PM
You know how to run valgrind? That could be interesting.
Title: Re: aMule is taking 16GB of RAM
Post by: btkaos on November 25, 2009, 04:17:43 AM
It is Ubuntu Jaunty 9.04 64bit. Customized but none of the changes touches amule.
99% sure this is a known bug in libx11. Update your Ubuntu version or apply this patch:

http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=da6bbca07c796c69172a649405474f03bee66754
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 25, 2009, 10:17:28 AM
I have logs from when it happened, but they show nothing:

2009-11-24 20:17:12: Finished downloading: some file.zip
2009-11-24 22:23:24: Connected to Kad (firewalled)
2009-11-24 22:23:24: Connected to Kad (ok)


I cannot update my ubuntu to Koala cause I would lose too much of my customization.
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 25, 2009, 11:21:08 AM
Mh, I haven't used Ubuntu for a while, but in my experience a dist-upgrade doesn't impact customizations unreasonably. Do you speak from experience or do you fear it might screw things up?

On a side note: Please do not post potentially copyrighted file names here.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 25, 2009, 11:47:43 AM
Sorry about the filename. It eluded me.

I installed my 64bit 9.04 about seven months ago and since then I made loads of modifications to it, ranging from power saving tweaks to replacing nautilus with pcmanfm (also as desktop manager). I upgraded kernel, configured exotic hardware, replaced a lot of the default software, after long struggle managed to make hibernation and microphone work, even made office 2003 work in 80% of cases. Overall, only after I made many, many, many things to it, I was somewhat comfortable with it being my main operating system.

When I tried upgrading to Koala, I saw it wanted to remove/install a lot of programs I customized/don't want. Hence my question - can I upgrade this lib without going Koala?
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 25, 2009, 01:22:13 PM
Yes, you can re-compile the package with the patch.

This works more or less like this:
1. Download source packages [1] (http://archive.ubuntu.com/ubuntu/pool/main/libx/libx11/libx11_1.1.99.2.orig.tar.gz) and [2] (http://archive.ubuntu.com/ubuntu/pool/main/libx/libx11/libx11_1.1.99.2-1ubuntu2.diff.gz).
2. Extract the orig.tar.gz file, chdir into the resulting directory and execute zcat ../libx11_1.1.99.2-1ubuntu2.diff.gz | patch -p1 to prepare the debian package structure.
3. Download and apply the patch btkaos referred to [3] (http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=da6bbca07c796c69172a649405474f03bee66754)
4. Try to build the package with "dpkg-buildpackage". It will complain about missing packages, install these packages and try again.
5. Install the resulting deb file.

From my experience (I used Ubuntu from ca. 2005-2006), upgrades work more or less without affecting customizations. Usually it will mark files which will get overwritten with a comment inside the configuration file. But it's probably better to wait for 10.04 and upgrade to a LTS version.
Title: Re: aMule is taking 16GB of RAM
Post by: btkaos on November 26, 2009, 01:09:58 PM
I cannot update my ubuntu to Koala cause I would lose too much of my customization.
Then recompile the package.

The easiest way is:

[As a side note, you may preserve your customizations in the upgrade, but you'll have to use aptitude to do it and a little bit of care]
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 26, 2009, 11:28:02 PM
wuischke
I don't know how to apply this patch from point 3.

btkaos
What dsc file are you referring to? There are many libx11 packages and I don't know which one should I download.
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 26, 2009, 11:37:51 PM
The dsc file: http://archive.ubuntu.com/ubuntu/pool/main/libx/libx11/libx11_1.1.99.2-1ubuntu2.dsc

The package name is "libx11".

Regarding the patch:
Quote
Download the patch and save it to xlib-fix.patch
$ cd xlib...
$ cat ../xlib-fix.patch | patch -p1
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 26, 2009, 11:57:17 PM
Ok, but I don't have any "xlib" folder which means I cannot do "cd xlib..."
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 27, 2009, 07:51:51 AM
Sorry for not giving exact instructions. You have by some means (either my stupid manual way or btkaos' nice automatic way) extracted the source files, haven't you?

Please cd in this folder. The name might be libx11 or similar.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 27, 2009, 07:11:44 PM
Thanks, but now I am stuck here:

Code: [Select]
~/Desktop/patch/libX11-1.1.99.2$ sudo apt-get build-dep xlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
W: Duplicate sources.list entry http://gb.archive.ubuntu.com jaunty-updates/universe Packages (/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_jaunty-updates_universe_binary-amd64_Packages)
W: You may want to run apt-get update to correct these problems
E: Unable to find a source package for xlib
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 27, 2009, 08:04:42 PM
You might have to activate the source repository first. (Or try to execute "dpkg-buildpackage" and install the packages it says are missing.)

(Source (http://maketecheasier.com/9-things-you-need-to-doinstall-after-installing-ubuntu-904/2009/04/22) with Screenshot) To activate them with Synaptic, go to Settings -> Repositories in the package manager. There are 5 check boxes, the fifth reads "source", check it. Afterwards click on reload.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 27, 2009, 08:42:24 PM
As soon as one problem's down, another's up:
Code: [Select]
~/Desktop/patch/libX11-1.1.99.2$ sudo apt-get build-dep xlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to find a source package for xlib
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 27, 2009, 09:46:32 PM
The package's name is libx11, our instructions were not very exact in this regard.

Execute "sudo apt-get build-dep libx11" instead.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 27, 2009, 09:50:22 PM
Great. We are moving forward, albeit slowly:
Code: [Select]
~/Desktop/patch/libX11-1.1.99.2$ sudo dpkg-buildpackage
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package libx11
dpkg-buildpackage: source version 2:1.1.99.2-1ubuntu2
dpkg-buildpackage: source changed by Bryce Harrington <bryce@ubuntu.com>
dpkg-buildpackage: host architecture amd64
 debian/rules clean
Can't exec "debian/rules": Permission denied at /usr/bin/dpkg-buildpackage line 510.
dpkg-buildpackage: failure: debian/rules clean failed with unknown exit code -1
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 27, 2009, 10:26:40 PM
Code: [Select]
chmod +x debian/rules
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 27, 2009, 11:13:04 PM
Great, almost done:
Code: [Select]
dpkg-deb: building package `libx11-xcb-dev' in `../libx11-xcb-dev_1.1.99.2-1ubuntu2_amd64.deb'.
dpkg-deb: ignoring 1 warnings about the control file(s)
 signfile libx11_1.1.99.2-1ubuntu2.dsc
gpg: WARNING: unsafe ownership on configuration file `/home/juha/.gnupg/gpg.conf'
gpg: skipped "Bryce Harrington <bryce@ubuntu.com>": secret key not available
gpg: [stdin]: clearsign failed: secret key not available

 dpkg-genchanges  >../libx11_1.1.99.2-1ubuntu2_amd64.changes
dpkg-genchanges: not including original source code in upload
dpkg-buildpackage: binary and diff upload (original source NOT included)
dpkg-buildpackage: warning: Failed to sign .dsc and .changes file
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 28, 2009, 08:08:18 AM
I believe you can safely ignore this message. There should now be a libx11-xbc_1.1.99.2-1ubuntu2_amd64.deb package in the parent directory of the directory in which you were building the packages.

Please install this package (dpkg -i libx11[...].deb or using gdebi) and you should be done.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 28, 2009, 10:18:16 AM
I did as you said although there were 8 other DEB files there. Should I ignore the rest?
Title: Re: aMule is taking 16GB of RAM
Post by: wuischke on November 28, 2009, 10:34:59 AM
I think this should be enough. You were doing this to replace one file with the bug inside, after all.

Now you should try what made crash aMule previously and see if it's resolved now.
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 28, 2009, 10:50:22 AM
I am unable to replicate this bug at will as it seems that it was not necessarily connected to losing connection. However, it should occur within 1-2 days, if it has not been resolved. Will report back if it does.

Thank you for being extremely helpful and patient!
Title: Re: aMule is taking 16GB of RAM
Post by: Impactor on November 30, 2009, 09:05:23 PM
I can confirm the problem still exists. Updating libs did not help :(
By the way, the problem is not associated to losing connection, as I thought before.
Title: Re: aMule is taking 16GB of RAM
Post by: btkaos on December 01, 2009, 04:38:48 PM
Some comments:

Regards,
BTK
Title: Re: aMule is taking 16GB of RAM
Post by: lludriga1956 on December 07, 2009, 11:13:43 AM
Hi all,
I wonder if this post is related with the post from user "Lludriga1956" in the forum "Backtraces" entitled "amule 2.2.6 crashes after hours of running".

Thanks in advance for your time.
Title: Re: aMule is taking 16GB of RAM
Post by: vdb on December 09, 2009, 10:33:33 AM
I must say that I have seen similar behaviour with amuled on Solaris. I have traced it to failed connectivity to the aMule GUI: If the connection fails a few times somehow amuled starts to use the entire memory available to the user.

Luckily Solaris has advanced resource management features so the hogging can be limited to a few hundred megabytes. But it is very reproducable.