<?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: in-process .da searchcursor question in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304684#M23661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think it's a lock problem... My only guess is that the screen flicker is the "in-process" script refreshing the screen upon having a new selection... I believe this "flashing" is perhaps the source of the excessive memory usage...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed up my code so that instead of using a da.SearchCuror it uses the arcpy.Describe.fidSet method (BTW: .fidset is a bit slower than using a da.SearchCursor to get a list of selected OIDs). Running this altered version of the script "in-process" yields the same memory leak behavior, and running it "out-of-process" via ArcMap toolbox throws basically the same error as when I was using the da.SearchCursor method. This time:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Tue Nov 20 17:04:32 2012 - 
*** PYTHON ERRORS *** 
Tue Nov 20 17:04:32 2012 - Python Traceback Info:&amp;nbsp;&amp;nbsp; File "C:\csny490\clusterId_v4.py", line 93, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; preSelectionOidSet = set(int(fid) for fid in arcpy.Describe("fl1").fidSet.split(";"))
Tue Nov 20 17:04:32 2012 - Python Error Info: &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 999999: Error executing function.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it seems that for whatever reason running scripts "out of process" via ArcMap toolbox can't access the table/selected features of the input feature layer when the input feature layer has selections applied to it in the script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:35:30 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-11T14:35:30Z</dc:date>
    <item>
      <title>in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304682#M23659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script that uses the arcpy.da.SearchCursor method. I am using v10.1 SP1. The script basically runs the SelectByLocation tool in a recurisive loop and identifies "spatial clusters" - that is groups of features that are all less than a certain distance from each other. I originally have this script running as an "in-process" toolbox based script. However, when run on extreemly large datasets, it exhibits some sort of memory leak (I notice the ArcMap screen flashes - I assume everytime the SelectByLocation/SelectByAttribute tool fires off), which ultimately causes ArcMap to issue an "out of memory" error at ~3.4 GB of RAM usage (ESRI gets lots of thanks for the now-standard large address aware in v10.1 BTW).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I noticed that if I run the script as a stand alone process via PythonWin, the memory usage never becomes and issue (and in fact stays &amp;lt; 300MB), and generally the script finishes much faster... Which is not what I would expect since I though running a script "in-process" was always the way to go. So I think, "Hey, I'll just make the script tool run "out-of-process" (via the toolbox), and memory problem solved!". Unfortunatly, when I do this, I find that the .da.SearchCursor can't read the featurelayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Why is the "in-process" method of running the script via ArcMap exhibiting memory leak behavior while running the script as "stand alone" via Python/PythonWin so much more efficient?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Why does the arcpy.da.SearchCursor blow up when it tries to read my feture layer when the script is run "out-of-process" via ArcToolbox in ArcMap". The pertinent error message is:&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;PRE class="plain" name="code"&gt;Tue Nov 20 15:31:47 2012 - 
*** PYTHON ERRORS *** 
Tue Nov 20 15:31:47 2012 - Python Traceback Info:&amp;nbsp;&amp;nbsp; File "C:\csny490\clusterId_v3.py", line 92, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; preSelectionOidSet = set([r[0] for r in arcpy.da.SearchCursor("fl1", ["OID@"])])

Tue Nov 20 15:31:47 2012 - Python Error Info: &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: cannot open 'fl1' &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 22:10:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304682#M23659</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-11-20T22:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304683#M23660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you maybe have a lock problem here?&amp;nbsp; If you run scripts out of process, you will sometimes get this type of error when accessing data sources that are open, or have been open, in the current mxd.&amp;nbsp; On the selectbylayer issue, I've noticed the blinking on several toolbox tools.&amp;nbsp; I haven't noticed memory leaks, but I haven't looked for them either.&amp;nbsp; SelectbyLayer and Calculate are 2 that I've noticed that do this.&amp;nbsp; Started with 10.1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 22:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304683#M23660</guid>
      <dc:creator>MikeHunter</dc:creator>
      <dc:date>2012-11-20T22:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304684#M23661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think it's a lock problem... My only guess is that the screen flicker is the "in-process" script refreshing the screen upon having a new selection... I believe this "flashing" is perhaps the source of the excessive memory usage...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed up my code so that instead of using a da.SearchCuror it uses the arcpy.Describe.fidSet method (BTW: .fidset is a bit slower than using a da.SearchCursor to get a list of selected OIDs). Running this altered version of the script "in-process" yields the same memory leak behavior, and running it "out-of-process" via ArcMap toolbox throws basically the same error as when I was using the da.SearchCursor method. This time:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Tue Nov 20 17:04:32 2012 - 
*** PYTHON ERRORS *** 
Tue Nov 20 17:04:32 2012 - Python Traceback Info:&amp;nbsp;&amp;nbsp; File "C:\csny490\clusterId_v4.py", line 93, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; preSelectionOidSet = set(int(fid) for fid in arcpy.Describe("fl1").fidSet.split(";"))
Tue Nov 20 17:04:32 2012 - Python Error Info: &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 999999: Error executing function.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it seems that for whatever reason running scripts "out of process" via ArcMap toolbox can't access the table/selected features of the input feature layer when the input feature layer has selections applied to it in the script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304684#M23661</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T14:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304685#M23662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Funny thing is that in my script I run an arcpy.da.SearchCursor on the input feature layer (before it has a selection placed on it) and that works fine, but as soon as the script issues a selection:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectLayerByAttributes("fl1", "NEW_SELECTION", "OBJECTID = " + str(1))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then trys to run a SearchCursor on "fl1" or arcpy.Describe("fl1").fidSet on the "selection-containing" feature layer the thing throws a rod... but only if the script is run "out-of-process" via an ArcToolbox script tool. If run "in-process" it's fine (but leaks memory like my grandma)... and if run stand alone it's fine and doesn't exhibit a memory leak.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 23:40:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304685#M23662</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-11-20T23:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304686#M23663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Curious... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any imports of 3rd party modules in the script?&amp;nbsp; Perhaps one that attempts to load needed .dll's to function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I just remembered something from some of my ArcObjects/.NET development work where I had some bottleneck issues when doing spatial selections/spatial relationship analysis.&amp;nbsp; The solution was to be absolute certain that the participating spatial data sets were in the same projection/coordinate system.&amp;nbsp; Not saying definitively this is the cause of your issue, but perhaps something to double-check.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 10:51:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304686#M23663</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-11-21T10:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304687#M23664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No 3rd party stuff...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found this simple code reproduces the issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
inLayer = arcpy.GetParameterAsText(0)
oidFieldName = arcpy.Describe(inLayer).oidFieldName
oidDict = dict([(r[0], -1) for r in arcpy.da.SearchCursor(inLayer, ["OID@"])])
arcpy.MakeFeatureLayer_management(inLayer, "fl1")
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; nextOidSeedValue = (key for key,value in oidDict.items() if value == -1).next()
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
arcpy.SelectLayerByAttribute_management("fl1", "NEW_SELECTION", oidFieldName + " = " + str(nextOidSeedValue))
selectedSet = set([r[0] for r in arcpy.da.SearchCursor("fl1", ["OID@"])])
arcpy.AddMessage("Selected set is: " + str(selectedSet))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When this is set up as a script tool and is run "in-process" or as a stand alone script with a hardcoded inLayer variable it works fine...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if it is not run as a script tool "out-of-process" if will fail on the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;selectedSet = set([r[0] for r in arcpy.da.SearchCursor("fl1", ["OID@"])])&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Python Traceback Info:&amp;nbsp;&amp;nbsp; File "C:\csny490\temp\ideas\selection_reprod.py", line 20, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; selectedSet = set([r[0] for r in arcpy.da.SearchCursor("fl1", ["OID@"])])

Python Error Info: &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: cannot open 'fl1'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:35:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304687#M23664</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T14:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304688#M23665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried using a non DA cursor there? Problem could be with the DA module.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 18:51:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304688#M23665</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2012-11-21T18:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304689#M23666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't answer the actual question (i.e. why is that behaviour occurring?) but I can say that I've had to do a similar task (find all records in same feature class within Xkm of each individual records). I found SelectLayerByLocation too slow, so I went about it a different way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Use the Select tool to extract the current record into a temp IN_MEMORY fc containing a single point&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Create an empty geometry object&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Use the Buffer tool to buffer the temporary point FC into the geometry object&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Clip the original points fc using the geometry object as the clip features.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;The results of the clip contains the features within X km of your original point. I guess it depends on what you're doing with the output, this prob won't work if you're looking to calculate a value back into the original FC or something. Although you could build up a dictionary of {source: [neighbours]} which you could then use to re-iterate over the original FC and apply the attributes I suppose.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some sample pseudocode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.env.workspace = "IN_MEMORY"
buff_geom = arcpy.Geometry()

with arcpy.da.SearchCursor(points_fc,cur_fields) as cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_row_oid = row[0]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Select the point we're looking at into "tempTarget"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_row_selector = '"{0}" = {1}'%.format(oid_field, current_row_oid)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Select_analysis(points_fc, "tempTarget", current_row_selector)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get a geometry containing an $analysis_distance buffer from current point
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buff_geom_list = arcpy.Buffer_analysis("tempTarget",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buff_geom,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "%s Meters"%analysis_distance)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Extract the nearby properties into "tempNearby"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(points_fc, buff_geom_list, "tempNearby")

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No idea if that will help you but thought I'd post it out of curiosity. Avoiding using feature layers altogether might mitigate the issue. I also found this noticeably faster (3-5x) than using the SelectByLocation tool. No idea how this will behave when you run it from ArcMap though, I was just using it externally.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd still be very curious to find out why it's happening and how to fix it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:35:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304689#M23666</guid>
      <dc:creator>ThomMackey</dc:creator>
      <dc:date>2021-12-11T14:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: in-process .da searchcursor question</title>
      <link>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304690#M23667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Temporarily gave up on this... Seems that there is some weird dependency on 'FeatureLayer' data types when run as an in-process vs. an out-of-process script tool. This sort of makes sense since there is a linkage between ArcMap TOC and the selected feature set in the script tool... When run out of process there is some sort of break in that linkage. This is a bug I think, but now with LargeAddressAware in v10.1 SP1 I can process my large dataset "in-process"... although it finishes right about at 3.05GB of RAM usage. I think I will submite this behavior as a bug to ESRI (Can't run a search cursor or .fidset describe property on an input feature layer when selections are applied to the feature layer in an 'out-of-process' script tool).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To Chris M: Nope, the old cursors exhibit the same behavior. And to boot, they are too slow (compared with .fidset or da.SearchCursor methods of retreiving the OIDs of the selected set).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To Thom: Negatory also... Your solution, which sounds familiar &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; BTW, won't work in my situation. This needs to loop 10's of thousands of times and copying stuff to in_memory would slow things down and probably cause more memory usage.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 16:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/in-process-da-searchcursor-question/m-p/304690#M23667</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-12-03T16:36:57Z</dc:date>
    </item>
  </channel>
</rss>

