Reduced memory usage

Add Memory Usage summary to the log file.
GetJustFormat to reduce memory use
Fix code so that children are not disposed while they are being used
Added new method GetJustFormat to reduce memory use
Fix logic so that content is not used after it is disposed
Verify that Content object is not disposed before using Text
Dispose of parts when Content object is disposed
Verify that ContentInfo object is not disposed before using Text
Dispose of parts when ContentInfo object is disposed
Place brackets around DB names to support names containing periods.
Dispose of parts when Item object is disposed
Removed inapproriate Dispose in MakeItem
Dispose of parts when ItemInfo object is disposed
Remove event handler when ItemInfoList object is disposed
Dispose of parts when Transtion object is disposed
Dispose of parts when ZTransition object is disposed
This commit is contained in:
Rich
2012-05-29 18:02:17 +00:00
parent 58cb0f1c77
commit 9f45759050
15 changed files with 140 additions and 32 deletions

View File

@@ -139,7 +139,7 @@ namespace DataLoader
// test for performance
Content cont;
Format fmt2 = format == null ? null : format.Get();
Format fmt2 = format == null ? null : format.GetJustFormat();
cont = Content.New(Number, Title, 10000+docstyleindx, fmt2, ci==null?null:ci.ToString(), Dts, Userid);
if (needEntry)
{

View File

@@ -180,12 +180,15 @@ namespace DataLoader
}
if (frType > 0)
{
using (Content c = Content.Get(parentItem.ContentID))
{
c.ContentParts.Add(frType, item);
if (!c.IsSavable) ErrorRpt.ErrorReport(c);
c.Save();
}
//using (Content c = Content.Get(parentItem.ContentID))
//{
// c.ContentParts.Add(frType, item);
// if (!c.IsSavable) ErrorRpt.ErrorReport(c);
// c.Save();
//}
parentItem.MyContent.ContentParts.Add(frType, item);
if (!parentItem.MyContent.IsSavable) ErrorRpt.ErrorReport(parentItem.MyContent);
parentItem.MyContent.Save();
}
// Remove styles that user entered but are automatically done via the format

View File

@@ -17,7 +17,6 @@ namespace DataLoader
InitializeComponent();
_MyParent = myParent;
}
private List<string> _MyMessages = new List<string>();
private int _ErrorCount = 0;
public int ErrorCount
@@ -54,7 +53,6 @@ namespace DataLoader
default:
break;
}
_MyMessages.Add(err);
tbErrors.SelectionStart = tbErrors.TextLength;
tbErrors.SelectedText = sep + err;
sep = "\r\n";
@@ -75,9 +73,8 @@ namespace DataLoader
}
public void Save(string path)
{
StreamWriter fs = new StreamWriter(path,false);
foreach (string txt in _MyMessages)
fs.WriteLine(txt);
StreamWriter fs = new StreamWriter(path, false);
fs.Write(tbErrors.Text);
fs.Close();
}
}

View File

@@ -744,6 +744,7 @@ namespace DataLoader
ProcessComplete = false;
Clipboard.Clear();
Clipboard.SetText(mb.ToString());
AddInfo(mb.ToString());
MessageBox.Show(mb.ToString(), "Processing Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void ConvertToChangeManager()