Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StructuredLogViewer fails to load large log files #22

Closed
imag0r opened this issue Jun 5, 2016 · 5 comments
Closed

StructuredLogViewer fails to load large log files #22

imag0r opened this issue Jun 5, 2016 · 5 comments

Comments

@imag0r
Copy link

imag0r commented Jun 5, 2016

I 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.

@KirillOsenkov
Copy link
Owner

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.

@KirillOsenkov
Copy link
Owner

I've made the app 64-bit for now, can you please run it, wait for it to auto-update, then close and run it again?

I'd be curious if setting it to 64-bit helps. Thanks!

@0x53A
Copy link

0x53A commented Jun 10, 2016

What would you think about using something like Sqlite as the storage format?
Then any consumer could (in theory) use custom sql queries to get the information they want, without you needing to implement a gui for everything.

@KirillOsenkov
Copy link
Owner

The appeal of StructuredLogger.dll as it is right now is that it's a single .dll without dependencies. This way we can optimize for performance and make sure that the logger doesn't slow down builds too much. Also if we control the serialization format we can optimize it as well.

Whatever we'll end up with as a storage format shouldn't matter since we'll be providing a public API to read that data and then you can use C#/LinqPad/LINQ to query that, which IMHO is a better experience than Sqlite can provide.

@KirillOsenkov
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants