<?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 Script Spawning Multiple Threads in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-spawning-multiple-threads/m-p/335886#M26309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm not a developer but do have to write the odd bit of code to automate output. I have written a script which uses an mxd which has 3 data frames with different&amp;nbsp;basemaps&amp;nbsp;and some textual information which serves as a template to produce a pdf. I have written a script&amp;nbsp;(attached)&amp;nbsp;which loops through the sites of interest zooms to the extent, adjusts the scale to a set scale and then populates the textual information including two tables by doing an intersection with a point and polygon feature class. It all works ok but tends to crash out in or around the 80th site that it hits. I thought at first it was a memory leak, hence all the del()'s but when I checked it out in the resource monitor I found memory consumption was low but the thread count is incrementing by 3 or 4&amp;nbsp;every time it loops. Anybody any ideas on why this might be happening or a workaround to fix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 13:56:56 GMT</pubDate>
    <dc:creator>LarryMcEvoy</dc:creator>
    <dc:date>2016-10-27T13:56:56Z</dc:date>
    <item>
      <title>Script Spawning Multiple Threads</title>
      <link>https://community.esri.com/t5/python-questions/script-spawning-multiple-threads/m-p/335886#M26309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm not a developer but do have to write the odd bit of code to automate output. I have written a script which uses an mxd which has 3 data frames with different&amp;nbsp;basemaps&amp;nbsp;and some textual information which serves as a template to produce a pdf. I have written a script&amp;nbsp;(attached)&amp;nbsp;which loops through the sites of interest zooms to the extent, adjusts the scale to a set scale and then populates the textual information including two tables by doing an intersection with a point and polygon feature class. It all works ok but tends to crash out in or around the 80th site that it hits. I thought at first it was a memory leak, hence all the del()'s but when I checked it out in the resource monitor I found memory consumption was low but the thread count is incrementing by 3 or 4&amp;nbsp;every time it loops. Anybody any ideas on why this might be happening or a workaround to fix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 13:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-spawning-multiple-threads/m-p/335886#M26309</guid>
      <dc:creator>LarryMcEvoy</dc:creator>
      <dc:date>2016-10-27T13:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script Spawning Multiple Threads</title>
      <link>https://community.esri.com/t5/python-questions/script-spawning-multiple-threads/m-p/335887#M26310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;without looking at your code it sounds like &amp;nbsp;that despite using del statements, python garbage collection isn't happening... pay attention to what happens when 3 arrays are created. &amp;nbsp;a is the original, b is a copy/clone of a and c is assigned to equal a. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything behaves nicely until a is deleted, b's data remains unchanged, but now c's data reference has moved to that of b. &amp;nbsp;so sometimes when you delete something, you have to be aware whether any 'copies' or 'references' to the originals still exist&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;copy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;memory at &lt;SPAN class="number token"&gt;0x10bbe6c48&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;memory at &lt;SPAN class="number token"&gt;0x10bbe6d08&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;memory at &lt;SPAN class="number token"&gt;0x10bbe6c48&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; a
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;memory at &lt;SPAN class="number token"&gt;0x10bbe6d08&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-spawning-multiple-threads/m-p/335887#M26310</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T15:55:00Z</dc:date>
    </item>
  </channel>
</rss>

