<?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 Python subprocess terminated unexpectedly, trying to use more memory than the container is configure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937075#M368212</link>
    <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We got an error when running Python Job in SAS Studio (SAS Viya 4 LTS 2023.10), which consume large amount of data (there are data query inside the python job). The error is related to the container memory limit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"ERROR: Python subprocess terminated unexpectedly. Exit code is 265 (0x0109). The most likely cause of this is the Python process trying to use more memory than the container is configured to be allowed to use."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried to increase the memory size of&amp;nbsp; sas-programming-environment container in sas-compute pod, up to 16GB, increase&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class=""&gt;System options&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;MAXTABLEMEM,&amp;nbsp;MAXMEMQUERY, and&amp;nbsp;MEMSIZE up to 2G&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;but still didn't solve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the specific container/pod of python process when running python job in SAS Studio, in which we have to enlarge the memory size? Or there are any configuration to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2024 05:22:41 GMT</pubDate>
    <dc:creator>asirait</dc:creator>
    <dc:date>2024-07-25T05:22:41Z</dc:date>
    <item>
      <title>Python subprocess terminated unexpectedly, trying to use more memory than the container is configure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937075#M368212</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We got an error when running Python Job in SAS Studio (SAS Viya 4 LTS 2023.10), which consume large amount of data (there are data query inside the python job). The error is related to the container memory limit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"ERROR: Python subprocess terminated unexpectedly. Exit code is 265 (0x0109). The most likely cause of this is the Python process trying to use more memory than the container is configured to be allowed to use."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried to increase the memory size of&amp;nbsp; sas-programming-environment container in sas-compute pod, up to 16GB, increase&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class=""&gt;System options&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;MAXTABLEMEM,&amp;nbsp;MAXMEMQUERY, and&amp;nbsp;MEMSIZE up to 2G&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;but still didn't solve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the specific container/pod of python process when running python job in SAS Studio, in which we have to enlarge the memory size? Or there are any configuration to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 05:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937075#M368212</guid>
      <dc:creator>asirait</dc:creator>
      <dc:date>2024-07-25T05:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python subprocess terminated unexpectedly, trying to use more memory than the container is confi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937138#M368224</link>
      <description>&lt;P&gt;I hit this same issue once trying to get a Python program migrated to Viya4.&amp;nbsp; The admin had to increase Launcher Service-&amp;gt;sas.launcher.default-&amp;gt;memory.limit and&amp;nbsp;Launcher Service-&amp;gt;sas.launcher.max-&amp;gt;memory.limit from 2GB up to 32GB before this one big geodataframe would load.&amp;nbsp; I first had to run the program on a Linux machine and see how much memory it used before I could tell the admin how much would be needed to run in the container.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS options like MEMSIZE, MAXMEMQUERY, etc. are applicable to how SAS does its processing within the available resources but not for how Python does its processing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 15:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937138#M368224</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2024-07-25T15:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python subprocess terminated unexpectedly, trying to use more memory than the container is confi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937149#M368229</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/461482"&gt;@asirait&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To optimize your Python subprocess memory consumptions, you may need to look into these links if your python code uses Pandas.&lt;/P&gt;
&lt;P&gt;Using Pandas 2.x with Arrow DataTypes, or using Polars 1.x as an alternative to Pandas Dataframe&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://pythonspeed.com/articles/pandas-load-less-data/" target="_blank" rel="noopener"&gt;https://pythonspeed.com/articles/pandas-load-less-data/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://datapythonista.me/blog/pandas-20-and-the-arrow-revolution-part-i" target="_blank" rel="noopener"&gt;https://datapythonista.me/blog/pandas-20-and-the-arrow-revolution-part-i&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://pub.towardsai.net/pandas-vs-polars-bid-adieu-to-pandas-and-switch-to-polars-6d1f118994fa" target="_blank" rel="noopener"&gt;https://pub.towardsai.net/pandas-vs-polars-bid-adieu-to-pandas-and-switch-to-polars-6d1f118994fa&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://medium.com/@husein2709/pandas-2-0-vs-polars-pvp-d8aec54c3fc8" target="_blank" rel="noopener"&gt;https://medium.com/@husein2709/pandas-2-0-vs-polars-pvp-d8aec54c3fc8&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://medium.com/@kevinmenesesgonzalez/polars-vs-pandas-the-future-of-data-frames-c508fc4408dc" target="_blank"&gt;https://medium.com/@kevinmenesesgonzalez/polars-vs-pandas-the-future-of-data-frames-c508fc4408dc&lt;/A&gt;&amp;nbsp;(one more link)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 18:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937149#M368229</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-07-25T18:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python subprocess terminated unexpectedly, trying to use more memory than the container is confi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937420#M368340</link>
      <description>&lt;P&gt;Thank you for the solution. We have configured the memory of launcher in environment manager as you mentioned, but it is not directly affected the size of the sas-programming-environment memory size in compute pod. Hence, we also increase the memory limit of&amp;nbsp;sas-compute-job-config on&amp;nbsp;launcher.sas.com up to 32Gi by using this script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kubectl -n scoring-engine annotate PodTemplate sas-compute-job-config --overwrite launcher.sas.com/default-memory-limit=32000Mi&lt;/P&gt;&lt;P&gt;kubectl -n scoring-engine annotate PodTemplate sas-compute-job-config --overwrite launcher.sas.com/max-memory-limit=32000Mi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After these configurations, the python job can be executed successfully.&amp;nbsp; The actual memory utilization is about 22Gi, so 24Gi for the memory is actually enough.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 10:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Python-subprocess-terminated-unexpectedly-trying-to-use-more/m-p/937420#M368340</guid>
      <dc:creator>asirait</dc:creator>
      <dc:date>2024-07-29T10:07:55Z</dc:date>
    </item>
  </channel>
</rss>

