Opened 16 years ago

Closed 12 years ago

#620 closed defect (fixed)

Import_taxonomy_species throws OutOfMemory error with file of all taxonomy with all data in species table from GRIN

Reported by: Mark J. Millard Owned by: bweaver
Priority: blocker Milestone: Release Candidate 3
Component: Import Wizard Version: 2.0.1677
Severity: Keywords: Taxonomy Import Wizard OutOfMemory
Cc: Database Engine: N/A
Operating System: Windows 7 Ultimate 64 bit

Description

I am loading a file with all fields from GRIN-Classic tax table into GRIN-Global using version 2.0.1679 install from DEV2. I get an OutOfMemory error after it processes 96,712 records during the verification process (there are 96,712 records in GRIN in tax table. When the exception is thrown on a check of taxonomy_species table there are 156,841 records in taxonomy_species. This is way off on what should be loaded.

Attachments (1)

taxonomy_species_all_96712recs_2010-12-11.zip​ (7.6 MB ) - added by Mark J. Millard 16 years ago.
Compressed file of all tax records in GRIN

Change History (8)

by Mark J. Millard, 16 years ago

Compressed file of all tax records in GRIN

comment:1 by Mark J. Millard, 16 years ago

Keywords: Taxonomy Import Wizard OutOfMemory added
Operating System: N/A → Windows 7 Ultimate 64 bit

comment:2 by bweaver, 16 years ago

The reason 'extra' records are being created is due to a few things:

  • The dataview definition for 'current species' does not contain the 'species_authority' field, so it is assumed to be null
  • The trigger for taxonomy_species uses the 'species_authority' field to generate the value that is put into the 'name_authority' field
  • The alternate unique key for taxonomy_species is defined as being 'name, name_authority'

Since the trigger auto-populates the name and name_authority fields based on other *_name and *_authority fields, there is a possibility a species record is being duplicated if the proper _name and _authority fields do not exist to properly calculate the name and name_authority values.

This will happen when a species record references one later in the file as its 'current' one. To make sure all records are created properly, one of the following must be done:

  • Include all fields for 'current' species that are required if it needs to be auto-created. i.e. duplicate all fields from the first set of species fields to the 'current' set.
  • Run through 2 different dataviews -- first populating just the species data, second just updating those records with the proper 'current' values

This situation occurs only in taxonomy_species because of the abnormal unique key and trigger situation that table has.

I am still troubleshooting why the out of memory error occurs because I thought I had that completely fixed. But the above explains why there are extraneous records, but not 2x the expected records.

comment:3 by bweaver, 16 years ago

(In [1688]) - refs #620, #621, #622, #623. Close, but still one last bug fix to test (out of memory issue)

comment:4 by bweaver, 16 years ago

Status: new → addressed

(In [1690]) - fixes #620. Previous commit actually fixed #620, but it was completing with only about 100 MB of data left in the available .NET heap (approximately 1.1 GB allocated). This commit reduces the number of copies stored in memory by 1 and has more .Dispose() and GC.Collect() calls strategically placed to minimize the amount of allocated memory. Result is only about 800 MB being allocated for taxonomy_species import.

  • fixes "String s is not an instance of a string" error when clicking "Test Connection"

comment:5 by bweaver, 16 years ago

Status: addressed → released

comment:6 by bweaver, 16 years ago

(In [1694]) - refs #620. Added a dt.Clear() call, which in turn caused the "< Fix Errors" button to fail when server-side errors occurred after clicking Import. The Clear() was causing the referenced rows to be dropped out of memory and clicking "< Fix Errors" was trying to reference them. Removed the Clear() call.

  • also added BeginLoadData() and EndLoadData() calls to suppress notifications / index updates / constraint checks within the DataTable objects, since we are doing large chunks at a time and we ignore that metadata anyway. This seems to have sped up the datatable processing portion considerably (30% faster or so).

comment:7 by Mark J. Millard, 12 years ago

Resolution: → fixed
Status: released → closed
Note: See TracTickets for help on using tickets.