Updating some scripts from 2.7 to 3 in hopes of solving a memory leak that is causing an 'Out of memory' error when rebuilding a small (~50k edges) Network dataset in our maintenance tasks. I didn't see anything mentioning this in the bug reports so thought I'd post it here if anyone else experienced this.
I started using the legacy 'in_memory' space but it looks like the CopyFeatures tool cannot output to it. I need to create copies of data in order to modify fields and other data without changing the underlying data. I verified that nothing is written by testing with arcpy's get count and the feature count = 0. Changed to 'memory' workspace and the count is right.
The script continues up to where I need to alter a few field names. Using the memory workspace for the outputs, the script fails with ERROR 000664: Invalid input: The type of dataset is not supported. If I revert back to 'in_memory', it alters the field just fine.
A simple sample:
in_memory = "memory\\" # "in_memory"
env.workspace = in_memory
adrSelection = arcpy.MakeFeatureLayer_management(anyfc, 'tNR', "symbol = 319")
adr = arcpy.CopyFeatures_management(adrSelection, os.path.join(env.workspace, 'tmpLyr'))
for flds in [('st_type', 'street_type'), ('use', 'use update')]:
arcpy.management.AlterField(adr, flds[0], flds[1], flds[1])