Select to view content in your preferred language

Arcpy Error: Out of Memory"

892
2
08-08-2018 05:13 AM
JordanMiller4
Frequent Contributor

When I run my py script I get an "Error: Out of Memory" at the last task arcpy.ImportXMLWorkspaceDocument_management. We're using 10.6 software by Esri. Does anyone know if it's related to how I wrote the script or possibly some other problem?

# Name: EnterpriseGDB.py
# Description: Import/Export the contents of my geodatabase to an XML workspace document.

# Import system modules
import arcpy
import os
import platform
import imp
import time

xmlDocument = r"C:\EnterpriseGDB.xml"

if arcpy.Exists(xmlDocument):
    print("Removing xml document")
    os.remove(xmlDocument)
    print("successful")

# Set overwrite output
arcpy.env.OverwriteOutput = True

# Set local variables for exports
in_data = r"Database Connections\SDE.sde"
out_file = r"C:\EIS\EISMASTER\eis shape\ArcMap\EnterpriseGDB.xml"
export_option = "DATA"
storage_type = "BINARY"
export_metadata = "METADATA"

# Set local variables for imports
target_gdb = r"C:\EIS\EISMASTER\eis shape\ArcMap\UPDM.gdb"
in_file = r"C:\EIS\EISMASTER\eis shape\ArcMap\EnterpriseGDB.xml"
import_type = "DATA"
config_keyword = "DEFAULTS"

print("Exporting SDE to XML Document")
# Execute ExportXMLWorkspaceDocument
arcpy.ExportXMLWorkspaceDocument_management(in_data, out_file, export_option, storage_type, export_metadata)
print("Finished Exporting")
time.sleep(120)
print("Importing NEW XML Document to Local GDB")
# Execute ImportXMLWorkspaceDocument
arcpy.ImportXMLWorkspaceDocument_management(target_gdb, in_file, import_type, config_keyword)
print("Finished Importing!")
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
Tags (1)
0 Kudos
2 Replies
MichaelVolz
Esteemed Contributor

Do you have the ability to try this script an another computer running 10.6?  Or possibly try running the script on a computer running an older version such as 10.5.x?

What kind of SDE geodatabase are you trying to extracting data from (e.g. SQL Server, Oracle, other)?

0 Kudos
JordanMiller4
Frequent Contributor

I've got it running on another computer right now. I'll check it in a few to make sure it's running properly and get back to here.

Additional Information:

The second PC running the script has the same version. If it fails I will try the script on another PC with 10.5.

The SDE geodatabase is hosting in SQL Server 2012.

0 Kudos