c# - Reading .xps file causes OutOfMemoryException -


when use c# read .xps file, outofmemoryexception.
got information opening xps document in .net causes memory leak, seems not work in code.

my code below:

using (xpsdocument document = new xpsdocument(xpspath, system.io.fileaccess.read)) {     fixeddocumentsequence fds = document.getfixeddocumentsequence();      int pagecount = fds.documentpaginator.pagecount;      (int = 0; < pagecount; i++)     {         documentpage source = fds.documentpaginator.getpage(i);         visual v = source.visual;         fixedpage fixedpage = (fixedpage)v;          fixedpage.updatelayout();     }                document.close(); } 
  1. when remove line fixedpage.updatelayout(). through win8's "task manager", current program's use of memory increased 10mb each time while read 1 .xps file.
  2. when add line, use of memory still increased 1mb each time.

any 1 can me?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -