Menu

OutOfMemoryException

Help
Stas
2012-02-27
2013-01-17
  • Stas

    Stas - 2012-02-27

    Hi all.
    Library is working almost normally, but there is a problem.
    If you try to handle large files (larger than 200 megabytes), an error occurs in module FileMARC.cs

          / / public void Add (string source)
             / / {
             / / Source = CleanSource (source);

             / / Foreach (string record in source.Split (END_OF_RECORD))
             / / {
             / / / / Make sure the record isn't empty, or isn't the end of a file
             / / If (record! = String.Empty && record! = "\ X1A")
             / / {
             / / / / Split removes the END_OF_RECORD. Put it back in
             / / This.rawSource.Add (record END_OF_RECORD.ToString ());
             / /}
             / /}
             / /}
    Probably worth adding to alter records on the block

     
  • Matt Schraeder

    Matt Schraeder - 2012-03-01

    Thanks for the report. I'll look into how I'm handling larger files and see if I can come up with a solution.  

     
  • Matt Schraeder

    Matt Schraeder - 2012-06-13

    This should be fixed in the latest release through the use of the FileMARCReader class.

    string filename = "manyrecords.mrc";
    FileMARCReader reader = new FileMARCReader(filename);
    int target = 100;
    foreach (Record marc in reader)
    {
    //Use the record object as you normally would
    }
    reader.Dispose();

     

Log in to post a comment.