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:
acinclude.m4: MULE_IF_ENABLED([optimize], [MULE_ADDCCXXFLAG([-O2])])
by
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?]