StructuredLogViewer fails to load large log files
See original GitHub issueI have a build which produces 1.5GB log file with StructuredLog logger. When trying to load it to the viewer, I get OutOfMemoryException:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Text.StringBuilder.ToString() at System.Xml.XmlTextReaderImpl.FinishPartialValue() at System.Xml.XmlTextReaderImpl.get_Value() at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at Microsoft.Build.Logging.StructuredLogger.XmlLogReader.ReadFromXml(String xmlFilePath, Action1 statusUpdate) in C:\MSBuildStructuredLog\src\StructuredLogger\Serialization\XmlLogReader.cs:line 22
This can be easily fixed by unchecking ‘Prefer 32bit’ option in StructuredLogViewer project build settings, to allow the 64bit JIT for AnyCPU configuration.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
I need a fast and compact binary serialization format. XML was good for a prototype, but for large projects such as yours it is wasteful and inefficient.
I’ll need to look into Protobuf.Net, Microsoft Bond or just roll a custom binary serialization format for the log files in addition to XML.
And yes, setting Prefer 32 bit to false is a cheaper workaround which I shall apply as well.
Hi @imag0r and @0x53A. I’ve just published a new version that supports a compact binary log format: *.buildlog. When passing the log file name to MSBuild, use the .buildlog extension instead of .xml. The UI will now default to .buildlog.
I’ll be closing this issue but let me know if there’s anything else I can do to improve it.
I’d be curious to the numbers you get on the log file size for your large builds. How much better is it?