Azureus: High Memory Usage, ignores -Xmx VM parameter

Bug #160717 reported by Thom Pischke
2
Affects Status Importance Assigned to Milestone
azureus (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Since I use Azureus on a laptop limited to 196MB memory, I'm very watchful of its memory usage. I've read that it should be possible to keep Azureus in the neighborhood of 50MB, but have found personally that it uses quite a bit more, more on the order of 100MB.

Followed the tips provided here to try to reign in memory usage: http://www.azureuswiki.com/index.php/Reduce_memory_usage

Unfortunately, none of this seemed to help on Xubuntu. Most distressing is that adding -Xmx64m or even -Xmx32m seems to have little or no effect on the memory usage as reported by the top and/or the System Monitor. Even with -Xmx32m being added in /usr/bin/azureus, Azureus jumps to over 50MB already during startup. I would expect an OutOfMemoryError if azureus really required 50MB and was forcefully restricted to 32MB, so something is wrong.

Revision history for this message
Thom Pischke (thom-pischke) wrote :

Note that I'm using the version being developed here:

https://bugs.launchpad.net/ubuntu/+source/azureus/+bug/68020

Revision history for this message
John Dong (jdong) wrote :

As far as I can see Azureus respects its heapsize set via -Xmx, setting it to 16MB then trying to open help/about will cause an OutOfMemoryError crash. Note the with Azureus starting a torrent is an extremely lowcost procedure, hence why it doesn't seem to cause a crash.

Note that Azureus also uses directly-allocated memory, which is by default bound to the same size as the heap size. Azureus also by default has a 5MB cache enabled, which uses memory. In addition, SWT widgets and other parts of the GUI might use X11 or system memory not bound by the Java heap. /usr/bin/azureus by default sets the heap to 1024M because small heaps can cause OOM errors on large torrents.

For me, Azureus starts at around 37MB, and in the course of 3 days or so grows to around 60-70MB while doing 4 torrents, which is very respectable memory usage -- it's a bit higher than KTorrent, and honestly about on par with Deluge.

Do you have any 3rd party plugins enabled? If memory usage is increasing over time, try disabling DHT (if that's possible) -- that's the only thing that should be "growing" over time.

Changed in azureus:
status: New → Incomplete
Revision history for this message
Thom Pischke (thom-pischke) wrote :

The only plugin I have installed is the SafePeer plugin. Otherwise it's a straight install. As for DHT, isn't that on by default.

Will try to dup the OutOfMemory error with -Xmx16m. For me, this is the crux of the issue. Either I'm setting this wrong somehow in the launch script, or something is buggy in the azureus/java combo. If I can that much to work, then I can start whittling away at the actual internal usage. Limiting the JVM to 32MB and seeing it shoot up to 100MB anyway is simply a no-starter.

Revision history for this message
John Dong (jdong) wrote :

Ok, I've installed safepeer and loaded that default blocklist and joined the Fedora Core 7 torrent swarm, and usage shot up to 150MB and seems to grow rapidly.

Turn it off and RAM usage cuts in half.

I think Safepeer is a factor in this.

Revision history for this message
Thom Pischke (thom-pischke) wrote :

So I guess this would mean SafePeer runs outside the JVM that azureus runs in? Don't know anything about how it's implemented, but could explain why the JVM memory cap is being ignored.

Will try testing with that plugin removed. If it really gobbles that much memory, it's not worthwhile anyway.

Revision history for this message
John Dong (jdong) wrote : Re: [Bug 160717] Re: Azureus: High Memory Usage, ignores -Xmx VM parameter

As I explained before, heap memory is only one of several types of
RAM-related resources that Java uses -- there's directly allocated
memory, class definition memory, JVM overhead, JIT caching, external C
libraries, and many other features associated with Java that use memory
but are not controlled by the heap. I don't know what part of Safepeer
is so memory intensive, nor do I know how to profile Java applications
for RAM consumption.

Revision history for this message
Thom Pischke (thom-pischke) wrote :

Sorry, was just wondering aloud. Don't expect you to fix the SafePeer plugin :) Sounds like the solution to this bug is simply not to use it.

Revision history for this message
Thom Pischke (thom-pischke) wrote :
Revision history for this message
Thom Pischke (thom-pischke) wrote :

And here: http://forums.whirlpool.net.au/forum-replies-archive.cfm/539478.html

'Safepeer is good, but I found that it bumped Azureus' memory usage from about 40meg to over 150 meg. Try Peerguardian (open source), the website is phoenixlabs.org and you can dl it from sourceforge. It does the same thing, but only uses 6 to 8 meg.'

Revision history for this message
John Dong (jdong) wrote :

Sure thing, no problem. I am going to close the bug report as it does not appear to be a problem in the Ubuntu Azureus package. (Personally, I think the premise/rationale behind PeerGuardian style blacklists is very flawed and doesn't do anything but filter out legitimate peers and keep you downloading longer, which might even be worse if your goal is to not let someone scrape your IP from the tracker)

Changed in azureus:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.