Page 1 of 2

Guide: Increasing Subsonic Memory Limit

PostPosted: Wed Aug 11, 2010 9:53 pm
by Kirk
I've been watching the Help boards for awhile, and it seems to me that a lot of Subsonic issues are simply caused by the application running out of memory. On modern hardware, with plenty of RAM, this shouldn't be an issue. Increasing Subsonic's memory usage limit is very easy.

I had to fumble around on Google for a few minutes to figure out how to do it on Ubuntu... I decided I'd post this guide here, with a nice subject line for Googlers to stumble on so this process can be painless to someone less experienced than I myself.

For the convenience of the viewers, I am also including some image documentation on how to do this. Raising your memory limit is really easy... let's make it a no-brainer.

Increasing Subsonic Memory Limit on Windows
- Right click the Subsonic icon in the system tray. (The area on the bottom right, where the clock is).
Note: Your Subsonic icon may be hidden. Expand the system tray if you don't see it.
Image

- Click "Subsonic Control Panel" on the menu.
Image

- Go to the Settings tab.
Image

- Increase the memory limit to the desired amount. 512MB should be great for any typical setup.
Image Image

- You will need to restart Subsonic for the changes to take effect. Click OK on the dialog...
Image

- Then go back to the Status tab. Hit STOP, then hit START. Subsonic has now restarted, and is running with an increased memory limit.
Image Image



Increasing Subsonic Memory Limit on Ubuntu or Debian
- Open a terminal or an SSH session to your Subsonic server.
- Open the file "/etc/default/subsonic" in your favorite text editor. I like Pico.
Image
Image

- Change the max-memory directive from 100 to your new memory limit. (In Megabytes). 512 should be great for any typical usage scenario.
Image

- Restart Subsonic. Subsonic is now running with your new memory limit.
Image



If anyone wants to prepare a short how-to for Mac OS X, that'd be great... I only have Linux and Windows to play with.

Cheers,
Kirk

PostPosted: Wed Aug 11, 2010 10:40 pm
by mgrant
Standalone linux:
edit subsonic.sh (in whatever path you extracted it)
then stop and restart subsonic

Tomcat linux:
edit /etc/default/tomcat6 (set JAVA_OPTS)
then restart tomcat

Tomcat windows:
run tomcat6w.exe and set JAVA_OPTS from there
then restart tomcat

Standalone windows:
edit subsonic.bat (in whatever path you extracted it)
then stop and restart subsonic

Others?

-mg

PostPosted: Sat Aug 14, 2010 1:54 am
by aktiveradio
is there is baseline for this setting? 512 seems low if the system has 4 gb of ram right?

PostPosted: Sat Aug 14, 2010 11:17 pm
by Kirk
aktiveradio wrote:is there is baseline for this setting? 512 seems low if the system has 4 gb of ram right?


My 512 is merely for example purposes. Yes, it could be higher. I don't think there is an upward limit. However, allocating merry that isn't going to be used is pointless... I run my Subsonic server with 512MB and have no issues.

Naturally you are free to increase your memory limit as you please.

Cheers,
Kirk

PostPosted: Tue Sep 21, 2010 3:39 pm
by donpearson
Moved to Tutorials :wink:

PostPosted: Tue Sep 28, 2010 9:01 pm
by Kirk
donpearson wrote:Moved to Tutorials :wink:


Good call. :mrgreen:

Service wont start above 1630MB

PostPosted: Thu Jan 13, 2011 10:39 pm
by mgyellow
I've been fiddling with the memory settings because of video playback pausing (still working on that) and noticed that setting this memory limit above 1630MB will cause the service to fail starting.

I do the following:
- Stop service (using status tab or using services.msc)
- Set memory limit to 1631MB
- Start service (user either tab or msc)
- Look at service log last line: Shutting down database

Anything below 1631 works fine.

Changing this limit didn't help with my problem though, just thought i'de mention it here

Windows Server 2008 R2, 8GB memory

OS X User here

PostPosted: Mon Feb 21, 2011 1:44 pm
by bam0027
I'd be happy to post a tutorial, but I haven't been able to find where to adjust this memory declaration. I'm currently running out of memory, using 94+ of the 97 MB default. This error ("java.lang.OutOfMemoryError") in my library listing prompted me to hunt for solutions, thus I ended up here.

I can't find a subsonic.sh, nor can I find the "SUBSONIC_MAX_MEMORY" string anywhere.

Solutions has been posted...

PostPosted: Wed Feb 23, 2011 10:57 am
by bam0027
... by jrh.koenig here: http://forum.subsonic.org/forum/viewtopic.php?t=5776

In short, modify line 37 of info.plist file, found within the Package Contents of the Subsonic application (Control-Click the application, select "Show Package Contents" form the contextual menu). Change the three digit number value within the string argument to be the size of the memory for Java to use.

jrh.koenig (Johannes) says:
you have to edit following file to increase the memory settings:
/Applications/Subsonic.app/Contents/Info.plist
at line 37 -Xmx100m to -Xmx256m or whatever your installation needs.

you will find that information in the installation dokumentation on www.subsonic.org for MacOSX.

One last note

PostPosted: Wed Feb 23, 2011 11:00 am
by bam0027
As far as I can tell, this modification to the memory on OS X will overwritten when a program update is installed. Hopefully, in the future, the application will be modified to store this setting in the /Library folder outside of the application itself.

PostPosted: Wed Mar 02, 2011 5:36 pm
by nachos
Great post!

Here's the instructions for CentOS / Fedora / Red Hat Enterprise Linux (REHL)

open subsonic's config file:
/etc/sysconfig/subsonic

and edit as needed:
SUBSONIC_ARGS="--max-memory=512"

PostPosted: Sun Mar 13, 2011 9:54 pm
by ggibby
I can't get it to restart with any setting over about 1000MB...

PostPosted: Mon Mar 14, 2011 8:55 pm
by OlYeller21
I had a problem that was solved by increasing the memory limit. I've also seen many with problems that are solved by increasing the memory limit.

I suggest a sticky on this post.

PostPosted: Wed Mar 30, 2011 8:51 pm
by Numanoid
A small problem I had that I thought I'd share in case anyone else encounters a similar problem:

In Windows Vista, I got an error about not being able to write to the exe when clicking "Save Settings". I solved it by checking "Run As Administrator" in the Compatibility properties for the Subsonic Tray Icon.

PostPosted: Sat Apr 16, 2011 6:58 pm
by Kirk
Whoops, I totally forgot I was hosting the images for this on one of my domains when I took some of my hosted content down for server overhauls back in February.

My bad! The tutorial images have been restored.

Cheers,
Kirk