SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Mac Edition
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Mac Edition Discussion related to the SageTV Media Center for Mac edition. Questions, issues, problems, suggestions, etc. relating to the SageTV Mac edition should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2009, 10:21 PM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
How do I increase Java Heap Size in OS X? SOLVED!!!

Does anyone know how to set the Java Heap size in OS X?

I have read multiple threads on how to set it in windows by making registry changes etc, but I have not been able to find any references on the board on how to do this is OS X. I am running SageTV Mac 6.6.1 on Leopard Server 10.5.8. My current max is set at 265M, but I would like to set to 1024M or at least 512M.

I have googled references that state that to change, one has to edit the info.plist, Java Properties, and add a line like "VMOptions = -Xmx512M" but when I tried to add this to the info.plist in the "show packaged contents" of the SageTV app, it did not appear to work.

Now that I am running multiple tuners, I am started to hit a brick wall with "out of memory" messages which is shutting down my system.

Thanks.

Again, a big thanks to iconic for the solution which is provided here for quick reference:

Quote:
Originally Posted by iconic View Post
undocumented feature alert...

With "Property List Editor" (installed with XCode) or some other plist editor (Google it...)

Open /Library/Preferences/tv.sage.SageTV.plist
Create an entry under the root named "ClientMaxHeapSize", set its type to "number" and set the value to the maximum heap size in megabytes, e.g. 512 for 512 megabytes.

Last edited by merneric; 11-10-2009 at 04:43 PM.
Reply With Quote
  #2  
Old 10-13-2009, 07:54 AM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
Ok, I have now searched this entire forum for Java Heap Size and JVM Heap Size.

It seems that this is an easy thing to do in Windows via a simple registry edit:

Start, run, regedit <ok> starts the registry editor
HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Sage TV\JVMMaxHeapSizeMB
DWORD value: 200 (Hex) or 512 (Dec)


or to use babgvant's SageTV Registry Settings Tool

Also, it seems that it is relatively simple to accomplish in Linux as per Ikarius:

One notable optimization that is commonly mentioned is increasing the Java heap size. On windows, that is done via a registry edit. On linux, it's done in the script /opt/sagetv/server/startsage. On the line that calls java with a bunch of parameters, you should find a parameter that reads "-Xmx256m". That tells java to use a max heap size of 256 meg. Adjust to your taste- Mine is currently bumped to 512m.

However, I have found absolutely nothing which describes a way to accomplish this on the Mac in OS X! Obviously the registry settings do not apply, and I do not believe there is a "startsage" script in OS X.

Now I think that if any serious Mac user running SageTV server is going to use multiple extenders and Placeshifter clients, then the relatively low (265M) default JVM Heap size needs to be bumped up a bit.

I see that a lot of folks have viewed this thread, but that no one has offered a solution or even a comment, so I decided to send a request in to SageTV support. Hopefully they will answer soon, and when they do, I will be sure to post the solution...I can't be the only guy out there running SageTV server on a Mac!
Reply With Quote
  #3  
Old 10-13-2009, 10:30 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Try looking for a java control panel app. (I don't know what they call it in MAC OSX) Look for a Java tab and something called Java Runtime Environment Settings. Set the Runtime Parameter setting to -Xmx512m (or whatever you want the max to be.)

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #4  
Old 10-13-2009, 03:51 PM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
Gerry, thanks for replying. You have inspired me to look further, but unfortunately I still do not seem to be getting anywhere. I cannot find a "java control panel app" anywhere in OS X that has any kind of the settings that you described. I did come across an article that described the info.plist file which seems to be sort of the equivalent to the Linux 'startsage' script.

The info.plist file in SageTV mac can be found in /Applications/SageTV by just right clicking the SageTV app, and clicking "Show Package Contents" This then gets you the standard Contents, MacOS, and Resources directories, along with the info.plist file in question.

Within this file, there is a "Java" set of properties, and according to the link above, by inserting

<key>VMOptions</key>
<string>-Xmx512m</string>

within, this should set the JVM Max to 512M, but it does not seem to be working.

Below is a copy of the unmodified Java portion of the info.plist file:

<key>Java</key>
<dict>
<key>JVMVersion</key>
<string>1.4</string>
<key>NSJavaNeeded</key>
<true/>
<key>NSJavaRoot</key>
<string>Contents/Resources/Java</string>
<key>Properties</key>
<dict>
<key>apple.awt.showGrowBox</key>
<string>false</string>
</dict>
</dict>

If I shut everything down, stop the SageTV service, and modify to:

<key>Java</key>
<dict>
<key>JVMVersion</key>
<string>1.4</string>
<key>NSJavaNeeded</key>
<true/>
<key>NSJavaRoot</key>
<string>Contents/Resources/Java</string>
<key>Properties</key>
<dict>
<key>apple.awt.showGrowBox</key>
<string>false</string>
</dict>
<key>VMOptions</key>
<string>-Xmx512M</string>
</dict>

My JVM Heap size remains completely unchanged: (86MB/134MB/265MB). I have even tried restarting, and still has no effect. However, I wonder if this file has any effect at all, as the JVMVersion states 1.4, but when I check SageTV, it is running Java 1.5.0_20 which is the most current build for OS X 10.5.8

I have spent pretty much all day researching this to no avail.
Reply With Quote
  #5  
Old 10-13-2009, 06:01 PM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Some apps may have an ini file where the jvm settings are at. I'm not sure if Sage has one or not.

Also found this:
Quote:
User Preferences. Many applications choose their own installed directory structure for storing settings and user preferences. Others try to make use of whatever preference system exists on the host platform. In the latter case, on Mac OS X, user preferences for an application are typically stored in the ~/Library/Preferences directory, if those preferences are to be on a per-user basis. This directory could be reached from Java code by appending the String "Library/Preferences" to the user.home System property. An application that should have global preferences across all users could instead reside in /Library/Preferences from root.
Also look for Applications -> Utilities -> Java -> Java Preferences and go into the Advanced tab to see if jvm can be configured there.

Another note:
Quote:
Java 6 isn’t installed by default. Java 6 is available as a simple Software Update, so if your system is up to date, Java 6 is installed, else upgrade your system. Note that Java SE 6 won’t appear for users on 32-bit Intel machines (Intel Core and Intel Core Duo) even if their systems are fully up to date.
I don't have a Mac so I can't be of much more help.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #6  
Old 10-13-2009, 06:19 PM
Paul H Paul H is offline
Sage Aficionado
 
Join Date: Feb 2007
Posts: 250
Try this:
http://forums.sagetv.com/forums/down...do=file&id=316
Reply With Quote
  #7  
Old 10-13-2009, 06:21 PM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
I looked for the .ini file, but there is not one (that I could find).

As for Applications/Utilities/Java there does not seem to be such a folder. There is an app called Java Preferences within the "Utilities" folder itself though. When I open that, on the "General" tab, it is divided into Java Applet Plugin at top, and Java Applications at the bottom. In the pluglin portion, it allows you to pick either J2SE 5.0 32-bit or J2SE 1.4.2 32-bit. If I select the J2SE 5.0, and then click a button that says options, I then get a screen that allows input into a text box that says "Applet Runtime Parameters 1.5.0_20, 32-bit." Again, at first I thought "Yes!" this must be it, and I entered in "-Xmx512M" but it did not work. I also tried "VMOptions = -Xmx512M" but that did not work either.

Oh well, hopefully someone at SageTV support will get back with me, and if they do I will definitely post the solution here.
Reply With Quote
  #8  
Old 10-13-2009, 08:31 PM
flavius flavius is offline
Sage Icon
 
Join Date: May 2004
Location: New Hampshire
Posts: 1,257
Have you tried something like initial-heap-size="512m" and max-heap-size="1024m" in that pref pane?
Reply With Quote
  #9  
Old 10-14-2009, 08:47 AM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
Paul H - Thanks, but I'm pretty sure that app by babgvant *only* works in the windows registry, which would not apply on the mac.

flavius - although I am pretty sure that the correct parameters would be something like "-Xmx512M" I did try the things you suggested and they did not work.

I found this as well:

Mac OS X
*Using the Finder Menu, choose Go | Utilities
*Open the folder named "Java" if it exists
*For Mac OS 10.3.9 or ealier: Find the Plugin Settings program with the highest version number.
*For Mac OS 10.4 or and some 10.5 versions: Open the J2SE 5.0 folder, and run Java Preferences
*Type the following into the Runtime Parameters box:
-Xmx192M
*For Mac OS 10.5: Java Preferences is in the Utilities folder directly. Open this, and select the version at the top of the list. Then click the "Options..." button, and type the following into the Applet Runtime Parameters box:
-Xmx192M
*If you cannot find a "Options..." or a "Runtime Parameters" box, then you will need to edit a text file. Go to the Finder, and choose Go > Go to Folder... from the menu bar. Type ~/Library/Caches/Java and press Go. Drag the file deployment.properties into a text editor. Near the bottom of that file, find the line that says
deployment.javapi.jre.1.5.0.args=
and change it to read:
deployment.javapi.jre.1.5.0.args=-Xmx192M
*Restart Safari

So I tried editing the "deployment.properties" file in the user cache, but that did not help either. I am starting to think that maybe these changes only apply to web base java applications, but it seems there should still be a way to increase the JVM Heap for non "browser" assoc Java apps (if there is such a difference).
Reply With Quote
  #10  
Old 10-14-2009, 08:51 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
When I researched this I found that the app Eclipse had an eclipse.ini file that held those settings. Thought maybe Sage might have had the same setup but you said you couldn't find an ini file. You did open a support ticket to Sage on this issue, correct? It might take 2 or 3 day to get an answer.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #11  
Old 10-14-2009, 03:08 PM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
I put a support ticket in on Monday, hopefully we'll hear something back in the next day or so...
Reply With Quote
  #12  
Old 10-14-2009, 07:50 PM
flavius flavius is offline
Sage Icon
 
Join Date: May 2004
Location: New Hampshire
Posts: 1,257
Quote:
Originally Posted by merneric View Post
flavius - although I am pretty sure that the correct parameters would be something like "-Xmx512M" I did try the things you suggested and they did not work.
I did a quick check in the apple support forum and found a post where someone states success under 10.6.1.
Reply With Quote
  #13  
Old 10-16-2009, 09:40 AM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
flavius - I searched the apple support forums and I think I found the post that you mentioned. It talks about configuring the "jnlp" file with the parameters such as (initial-heap-size="512m"), which I believe (not 100% sure) is a type of configuration file for launching a web applet, which again I do not think would apply to launching a Java application (ie Sage).

Also, I did hear from SageTV Support yesterday, and while I am very grateful to have received a reply, unfortunately it did not resolve the problem:

"I spoke with one of the developers and they don't have that as part of the
Mac version. There may be some way to change the default for Java itself on
the Mac; but we don't know what that setting is, if it exists."


So it looks like this is going to take a lot more digging...
Reply With Quote
  #14  
Old 10-18-2009, 09:39 AM
flavius flavius is offline
Sage Icon
 
Join Date: May 2004
Location: New Hampshire
Posts: 1,257
Quote:
Originally Posted by merneric View Post
flavius - I searched the apple support forums and I think I found the post that you mentioned. It talks about configuring the "jnlp" file with the parameters such as (initial-heap-size="512m")
Different post.
Reply With Quote
  #15  
Old 11-03-2009, 01:03 PM
iconic's Avatar
iconic iconic is offline
Sage Advanced User
 
Join Date: Sep 2006
Posts: 138
Quick Fix

undocumented feature alert...

With "Property List Editor" (installed with XCode) or some other plist editor (Google it...)

Open /Library/Preferences/tv.sage.SageTV.plist
Create an entry under the root named "ClientMaxHeapSize", set its type to "number" and set the value to the maximum heap size in megabytes, e.g. 512 for 512 megabytes.
Reply With Quote
  #16  
Old 11-10-2009, 04:36 PM
merneric merneric is offline
Sage User
 
Join Date: May 2007
Posts: 63
THANK YOU iconic!!! The instructions that you provided worked like a charm!

It's been awhile since I checked the forums, and had almost given up hope, but after getting a "Out of Memory Detected - You need to increase your JVM Heap size" Error last night, I figured I would check again, and much to my delight your answer was there to save the day!

Thank you, thank you, thank you!!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Heap Size rickgillyon SageTV Beta Test Software 48 12-14-2011 04:47 AM
Java Heap Size craigap SageTV Media Extender 21 03-27-2010 10:53 AM
HD-PVR lockup related to Java heap size? troll5501 Hardware Support 14 11-04-2009 02:03 PM
Java Heap Size issue in SageMC on imported MCE (dvr-ms) recordings 71_Cuda SageMC Custom Interface 15 03-28-2009 08:54 AM
Jvm Heap Size broderp SageTV Software 6 08-30-2004 02:31 PM


All times are GMT -6. The time now is 12:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.