<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I increase java heap space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884770#M349559</link>
    <description>I was able to change the sas9.cfg to change jreoptions memsize and sortsize.&lt;BR /&gt;I verified the changes and the changes were correctly applied. In your case I would advice against changing the defaults since you have only 8gb RAM. You will always have make sure the OS has enough RAM to run. So if you would like to change then memsize could be set to 4gb and in that case jreoptions could be set to -Xmx256m -Xms1024m. I doubt that would change the outcome regarding the "Java virtual machine exception". If you want to try please let me know.</description>
    <pubDate>Fri, 14 Jul 2023 11:13:22 GMT</pubDate>
    <dc:creator>JosvanderVelden</dc:creator>
    <dc:date>2023-07-14T11:13:22Z</dc:date>
    <item>
      <title>How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884166#M349271</link>
      <description>&lt;P&gt;I am using SAS 9.4 M3 in Windows 10. It's a new installation after a Windows rebuild.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to draw a graph from a large dataset (4.5 gb) using Sgplot. The code&amp;nbsp; runs really slowly and eventually I get the following error code:&lt;/P&gt;
&lt;P&gt;ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: Java heap space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to change the java heap space allocated to SAS using a couple of different methods:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. by altering jre options in the the config file. I have changed the config file so that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Xms1024m&lt;BR /&gt;-Xmx1024m&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. I have also tried to alter the default java heap space in Windows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/17369522/set-default-heap-size-in-windows" target="_blank"&gt;https://stackoverflow.com/questions/17369522/set-default-heap-size-in-windows&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. I also tried opening SAS from a command prompt with the following jre options specified&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"c:\program files\SASHome\SASFoundation\9.4\sas.exe" -ls 80 -ps 60&lt;BR /&gt;-config "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"&lt;BR /&gt;-jreoptions '(-Xmx1024m -Xms2048m)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;None of these has altered the heap space, which I check by running the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token step keyword"&gt;proc options&lt;/SPAN&gt; &lt;SPAN class="token proc-args"&gt;&lt;SPAN class="token arg keyword"&gt;option&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token arg-value"&gt;jreoptions&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="token step keyword"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log returns&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;JREOPTIONS&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token comment"&gt;/* other Java suboptions */&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Xmx128m &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Xms128m&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;In addition to failing to draw a graph of the whole dataset, SAS runs extremely slowly when asked to draw many graphs on subests of the data. I haven't had these problems on previous installations of SAS. The time taken to create 2128 graphs is:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;NOTE: Writing HTML Body file: sashtml.htm&lt;BR /&gt;NOTE: PROCEDURE SGPLOT used (Total process time):&lt;BR /&gt;real time 4:35:13.73&lt;BR /&gt;cpu time 1:55.37&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Which equates to approximately 3.25 secnods of CPU time per graph- which seems really long.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 10:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884166#M349271</guid>
      <dc:creator>ninemileshigh</dc:creator>
      <dc:date>2023-07-10T10:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884181#M349281</link>
      <description>Do you want to set the jreoptions just for a single session or permanently?&lt;BR /&gt;If for a single session you can start sas via the command prompt with something like "sas -jreoptions '(-Xmx256m -Xms256m)'" Note: you can use higher values ex 512m or even 1024m but should only do that if needed and if you have lots of RAM. The suggested value is 1/4 of the memsize option set for the sas session. If you want to create a customized configuration file please read: &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/p0bmj7wjme32ayn1h4wim7trkhp6.htm#n19ns7rwcgjykbn1ffzdy6wuy795" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/p0bmj7wjme32ayn1h4wim7trkhp6.htm#n19ns7rwcgjykbn1ffzdy6wuy795&lt;/A&gt;</description>
      <pubDate>Mon, 10 Jul 2023 13:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884181#M349281</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-07-10T13:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884506#M349445</link>
      <description>&lt;P&gt;thank you for your reply. I owuld probably want to alter this permanently since I often use very large datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 8 gb of RAM, so would it make sense to increase the allocation as much as I can to speed up sgplot?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is, none of the methods of increasing heap space are working: I have tried a command prompt with increased jre options, AND I have also altered the config file, and yet SAS still only has 128 mb allocated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 16:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884506#M349445</guid>
      <dc:creator>ninemileshigh</dc:creator>
      <dc:date>2023-07-12T16:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884527#M349451</link>
      <description>&lt;P&gt;One might also consider the actual SGPLOT code involved. How much of that 4.5 Gb dataset is actually used by Sgplot? What type of plot/plots are involved? Perhaps a different plot approach would reduce memory need.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 17:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884527#M349451</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-12T17:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884529#M349452</link>
      <description>Trying to graph 4.5GB of data seems like it would tax a system for sure. &lt;BR /&gt;&lt;BR /&gt;Can you pre-summarize or simplify the data before using SGPLOT?</description>
      <pubDate>Wed, 12 Jul 2023 17:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884529#M349452</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-12T17:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I increase java heap space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884770#M349559</link>
      <description>I was able to change the sas9.cfg to change jreoptions memsize and sortsize.&lt;BR /&gt;I verified the changes and the changes were correctly applied. In your case I would advice against changing the defaults since you have only 8gb RAM. You will always have make sure the OS has enough RAM to run. So if you would like to change then memsize could be set to 4gb and in that case jreoptions could be set to -Xmx256m -Xms1024m. I doubt that would change the outcome regarding the "Java virtual machine exception". If you want to try please let me know.</description>
      <pubDate>Fri, 14 Jul 2023 11:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-increase-java-heap-space/m-p/884770#M349559</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-07-14T11:13:22Z</dc:date>
    </item>
  </channel>
</rss>

