Skip to content

OOM Exception after project load #854

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

Closed
nearwood opened this issue Apr 13, 2016 · 9 comments
Closed

OOM Exception after project load #854

nearwood opened this issue Apr 13, 2016 · 9 comments

Comments

@nearwood
Copy link
Contributor

See #820. I updated to VS2015 Update 2. Now I eventually receive a OOM error after opening the project, even if I just open a project and let VS sit for ~5 mins.

System.OutOfMemoryException was unhandled Message: An unhandled exception of type 'System.OutOfMemoryException' occurred in Microsoft.NodejsTools.Analysis.dll

Event log:

Log Name:      Application
Source:        .NET Runtime
Date:          04/13/16 09:47:32
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxx
Description:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
   at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.EnsureSize(Int32)
   at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.CheckGrow()
   at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.AddOne(Microsoft.NodejsTools.Analysis.AnalysisProxy)
   at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.Union(System.Collections.Generic.IEnumerable`1<Microsoft.NodejsTools.Analysis.AnalysisProxy>, Boolean ByRef)
   at Microsoft.NodejsTools.Analysis.AnalysisSet.Create(System.Collections.Generic.IEnumerable`1<Microsoft.NodejsTools.Analysis.AnalysisProxy>)
   at Microsoft.NodejsTools.Analysis.Analyzer.DependentKeyValue.AddTypes(Microsoft.NodejsTools.Analysis.ProjectEntry, Microsoft.NodejsTools.Analysis.JsAnalyzer, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet, Boolean)
   at Microsoft.NodejsTools.Analysis.Values.ExpandoValue.SetIndex(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet)
   at Microsoft.NodejsTools.Analysis.AnalysisSetExtensions.SetIndex(Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet)
   at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.AssignTo(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Parsing.Expression, Microsoft.NodejsTools.Analysis.IAnalysisSet)
   at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateBinary(Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator, Microsoft.NodejsTools.Parsing.Node)
   at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Microsoft.NodejsTools.Parsing.Node)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.ExpressionStatement)
   at Microsoft.NodejsTools.Parsing.ExpressionStatement.Walk(Microsoft.NodejsTools.Parsing.AstVisitor)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block)
   at Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.IfNode)
   at Microsoft.NodejsTools.Parsing.IfNode.Walk(Microsoft.NodejsTools.Parsing.AstVisitor)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block)
   at Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor)
   at Microsoft.NodejsTools.Analysis.Analyzer.FunctionAnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque`1<Microsoft.NodejsTools.Analysis.AnalysisUnit>, System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object)
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart(System.Object)
Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055

Node.js Tools   1.1.31117.00
Node.js Tools - Profiling   1.1.31117.00

Think I'll pull the source and check it out.

@mjbvz
Copy link
Contributor

mjbvz commented Apr 13, 2016

Thanks for the report. It looks like there may be a memory leak in the analysis engine.

Here are the Build instructions of NTVS. If you are working on NTVS 1.1, make sure to checkout the v1.1.x branch for testing. Master has the NTVS 1.2 Alpha code now. Please let me know if you run into any problems getting setup.

I'd start by trying to reproduce the issue with a local build. Then, using the the [Visual Studio Diagnostic Tools](visual studio diagnostic tools external code), you should also be able to observe memory usage over time, and take memory snapshots and memory diffs to see what objects are being leaked. The NTVS analysis engine code is complicated, but using the memory diagnostics tools will give you a good starting point for investigation.

Did you get a chance to try out the NTVS 1.2 Alpha as well? I suspect that using the ES6 Intellisense Preview option may work around this issue.

@nearwood
Copy link
Contributor Author

nearwood commented Apr 18, 2016

I took down the source and was able to build--the test projects failed though. I could not get included or latest versions of VSTestHost to install/work properly. Regardless of the tests, I might have time later this week to profile it but I can only attempt during any down time at work.

However, I did try 1.2 Alpha, and no problems so far.

@mjbvz
Copy link
Contributor

mjbvz commented Apr 18, 2016

Thanks you trying to look into this.

Yes, VSTestHost is only required for the (ui based) tests. If you build the full solution, there will be VSTestHost related build errors, but the NTVS extension should build and run just fine without it installed. I've run into a similar problem installing the included VSTestHost MSI recently on a Win10 VM and will look into updating the included installer.

No rush looking into the issue, and please let me know if you run into any other problems or could use any help with the investigation. Also, if the build instructions are unclear in any way, feel free to update them or let me know.

@rkavalap
Copy link

rkavalap commented Jun 6, 2016

In the last 15 mins, I had 4 restarts of VS launching the same project which just has 4 ts files. Not sure if all of the errors in the event viewer are errors from NodeJS tools itself.

vscrash

Event Viewer export.
VSCrash.zip

This is my VS configuration:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Enterprise

Architecture and Modeling Tools 00322-90000-92003-AA742
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015 00322-90000-92003-AA742
Microsoft Visual Basic 2015

Visual C# 2015 00322-90000-92003-AA742
Microsoft Visual C# 2015

Visual C++ 2015 00322-90000-92003-AA742
Microsoft Visual C++ 2015

Visual F# 2015 00322-90000-92003-AA742
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU 00322-90000-92003-AA742
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 5.208.60602.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015 (RC1 Update 1) 14.1.11106.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/

Clang with Microsoft CodeGen 14.0.25317
Clang with Microsoft CodeGen

Common Azure Tools 1.7
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

KofePackagePackage Extension 1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure HDInsight HQL Service 2.0.2900.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio 2.0.2900.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools 2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.40211.2

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Node.js Tools 1.2.40329.01
Adds support for developing and debugging Node.js apps in Visual Studio

Node.js Tools - Profiling 1.2.40329.01
Profiling support for Node.js projects.

NuGet Package Manager 3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio 2.2.40315.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration 2.2.40315.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support 2.2.40315.00
Profiling support for Python projects.

SQL Server Data Tools 14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript 1.8.31.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android) 14.0.25116.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS) 14.0.25116.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Spell Checker VSSpellChecker
An editor extension that checks the spelling of comments, strings, and plain text as you type.
https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Tools for Apache Cordova Update 9
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps 14.0.25219.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Web Essentials 2015.2 2.0.214
Adds many useful features to Visual Studio for web developers. Requires Visual Studio 2015

Windows Installer XML Toolset 3.10.2.2516
Windows Installer XML Toolset version 3.10.2.2516
Copyright (c) Outercurve Foundation. All rights reserved.

Xamarin 4.0.3.214 (0dd817c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 6.0.3.5 (a94a03b)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS 9.6.1.8 (3a25bf1)
Visual Studio extension to enable development for Xamarin.iOS.

@rkavalap
Copy link

rkavalap commented Jun 6, 2016

After deleting the .ntvs_analysis.dat, and relaunching VS it didn't crash.

@mjbvz
Copy link
Contributor

mjbvz commented Jun 9, 2016

Issues like this with the analyzer should be fixed in NTVS 1.2. This release switches to a new IntelliSense engine by default that is much more performant and also offers better support for modern ES6 code. We do not have the resources to attempt to fixing the high memory usage on 1.1 with the old analysis engine.

If you run into any performance problems with NTVS 1.2, please open new issues to track these. Thanks.

@mjbvz mjbvz closed this as completed Jun 9, 2016
@rkavalap
Copy link

@mjbvz Unless I am not mistaken, I was using NTVS 1.2 Alpha based on the version info above. Are you suggesting they will go away in the future ? or already fixed in the existing 1.2 Alpha

@mjbvz
Copy link
Contributor

mjbvz commented Jun 13, 2016

@rkavalap Sorry, that comment was based on nearwood's original report.

What IntelliSense level are you on? This error should only show up in NTVS 1.2 if you are using Full/quick IntelliSense, instead of ES6 preview IntelliSense. ES6 IntelliSense is the default with NTVS 1.2.

@rkavalap
Copy link

@mjbvz Thanks for the update. Yes I use full Intellisense.

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

No branches or pull requests

3 participants