aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Limiting ram usage...a bit lower!  (Read 4243 times)

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Limiting ram usage...a bit lower!
« on: March 29, 2011, 07:33:21 PM »

Hi there!
I need amuled to use less memory...i'm running it on an at91sam9g20 with 64mb ram.
This is the config i'm using during the compilation:

./configure --host=$TARGET --with-zlib=$BUILDDIR/tmp --with-wx-prefix=$BUILDDIR/tmp --with-wx-config=$BUILDDIR/tmp/bin/wx-config --with-crypto-prefix=$BUILDDIR/tmp --prefix=$BUILDDIR/tmp --enable-amulecmd --enable-amule-daemon --enable-webserver --enable-alcc --disable-monolithic --enable-optimize --enable-mmap --disable-ed2k --enable-static --disable-amule-gui --disable-upnp --disable-nls  --disable-debug --with-libpng-prefix=/home/michele/Scrivania/build/tmp/

I really need KAD, this is the only thing! I've lowerd a lot the connections (50/50 if i remember).
Is there any other optimization that i can use during the compilation step?

Many thanks!
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Limiting ram usage...a bit lower!
« Reply #1 on: March 29, 2011, 11:26:41 PM »

You could try to compile amule with -Os, but I don't know if that will get you some gain.

Logged

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Limiting ram usage...a bit lower!
« Reply #2 on: March 30, 2011, 07:25:05 PM »

You could try to compile amule with -Os, but I don't know if that will get you some gain.



The parameter is not valid...are you sure of -Os ?? (i've also tryed --Os but still doesn't know the parameter).
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Limiting ram usage...a bit lower!
« Reply #3 on: March 30, 2011, 08:07:14 PM »

You could try to compile amule with -Os, but I don't know if that will get you some gain.



The parameter is not valid...are you sure of -Os ?? (i've also tryed --Os but still doesn't know the parameter).
Sorry, I didn't explain what has to change. In the file acinclude.m4 change:
Code: [Select]
acinclude.m4: MULE_IF_ENABLED([optimize], [MULE_ADDCCXXFLAG([-O2])])
by
Code: [Select]
acinclude.m4: MULE_IF_ENABLED([optimize], [MULE_ADDCCXXFLAG([-Os])])
and run configure again.

This tweak is untested and we don't know what could happen.

From my particular testing wxString was eating lot of ram, you could try to debug it by modifying wxWidgets.

By the way, has wxWidgets support for memory debugging (that is, trapping new and delete?]

Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Limiting ram usage...a bit lower!
« Reply #4 on: March 30, 2011, 08:09:57 PM »

You must also run autogen.sh
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Limiting ram usage...a bit lower!
« Reply #5 on: March 30, 2011, 08:41:15 PM »

Did some testing:
Code: [Select]
$ ./configure  --disable-ed2k --disable-alcc -disable-alc --disable-cas --disable-wxcas --disable-upnp --enable-optimize --disable-debug --disable-nls --enable-amule-daemon --disable-monolithic

With -Os
Code: [Select]
2161302 2011-03-30 20:32 src/amuled
$ strip src/amuled
1690800 2011-03-30 20:40 src/amuled
with -O2
Code: [Select]
2591188 2011-03-30 20:35 src/amuled
$ strip src/amuled
2149632 2011-03-30 20:38 src/amuled
So almost half a megabyte of saving. Not bad from a "free" optimization, but I guess you'll need to investigate runtime in order to have bigger savings. Don't forget to strip your binary if you are doing a "manual" install.

Logged

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Limiting ram usage...a bit lower!
« Reply #6 on: March 30, 2011, 09:29:47 PM »

Taking a look at your optimization i've tryed...but cannot get your results...
Using -Os i've taken an executable of 12mb and using "strip" i got a 4mb executable...but it eats a lot of ram...too much for me!
I only need the daemon and amulecmd,nothing more.

I've modified the .m4 and used this config:

./configure --host=$TARGET --with-zlib=$BUILDDIR/tmp --with-wx-prefix=$BUILDDIR/tmp --with-wx-config=$BUILDDIR/tmp/bin/wx-config --with-crypto-prefix=$BUILDDIR/tmp --prefix=$BUILDDIR/tmp --enable-amulecmd --enable-amule-daemon --enable-webserver --disable-alcc --disable-monolithic --enable-optimize --enable-mmap --disable-ed2k --enable-static --disable-amule-gui --disable-upnp --disable-nls  --disable-debug --disable-alc --disable-cas --disable-wxcas --with-libpng-prefix=/home/michele/Scrivania/build/tmp/


Any other suggestions?
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------