.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

VS 2010 memory leak?

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net

It happens frequently when I try to copy & paste code inside VS 2010 with following message:

insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try later.

and I check the memory usage with taskmanager on my computer. It is fine.

In order fix it, I need to close VS 2010 and restart again.

So is it a memory leak or can be fixed in some way?

View Complete Post

More Related Resource Links

Memory leak?


I’m not sure how I should consider my problem. I’m developing workflow with VS 2008 for MOSS 2007. I’ve created simple method which remove security group “MyGroup” from the item. And it seems that it works:

private void UsunDziedziczenieUprawnien_ExecuteCode(object sender, EventArgs e)


            using (SPSite site = new SPSite (workflowProperties.SiteId))

WmiPrvSE.exe causes a huge memory leak in SQL server 2008 R2, why?

My OS is windows server 2008 r2 data center 64 bit and my SQL server is server 2008 R2. The problem is when I open sql server, the WmiPrvSE.exe process consumes 20 - 60kbs every second. Several hours later, it eats up at least 200mbs memorry and this process seems like it will never stop. Can any experts give me some ideas to fit this mess? PS: My mainboard is Asus striker II formular, cpu is intel quad-core. Also, all my software are updated to latest version.

Memory leak on binding to a WPF TreeView

We're having an issue with a TreeView hanging onto a viewmodel set that has been bound to it. We have a static treeview on the main window, and reset its ItemsSource to Nothing or a new viewmodel when new things need to be displayed. The problem seems to be that it's hanging onto the first item that it was bound to, even after the ItemsSource is set to nothing. The connection seems to be through some strange unknown binding that's in the EffectiveValues collection of the TreeView.   I was able to repro this in a test project, so I'll post the simplified code:   TreeView templates:   <Window.Resources> <HierarchicalDataTemplate DataType="{x:Type local:ParentViewModel}" ItemsSource="{Binding ChildVMs}"> <TextBlock Text="{Binding Name}"/> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type local:ChildViewModel}"> <TextBlock Text="{Binding Name}"/> </DataTemplate> </Window.Resources>   ViewModel definitions: (Shared Function to generate the itemssource for the treeview)   Public Class ParentViewModel Public Shared counter As Integer = 0 Public Shared Function GenerateViewModel() As List(Of ParentViewModel) Dim pvm As New ParentViewModel With {.Name = "Parent" & counter} ' Unique name pvm.ChildV

InteropBitmap memory leak

Goal : Create a scrolling wave form that has a low overhead (WPF) Challenges : Huge bitmaps are not accepted by Image.Source Smaller (but still very big bitmaps) are accepted but overall UX is terrible. Memory conservation Scrolling must be at 60fps Problems encountered : Used GPU memory amount is insane ! (400 to 800 Mb each 10 seconds) So here's what I did : I am rendering that bitmap through an Image.Source that I created with Imaging.CreateBitmapSourceFromMemorySection (which type is InteropBitmap). I have loaded that big bitmap in memory and every time I need to update, I do a CopyMemory then I do InteropBitmap.Invalidate(), so far it's perfect and performance is excellent. That particular type of BitmapSource is said to be the fastest, and it is actually; but after some profiling, it litterally eats GPU memory, as said above. It seems that InteropBitmap never recycles GPU memory, or caches it, I don't know... On my Win7 x64 machine, I have 4Gb of which up to 1.5Gb can be used by the GPU. (Laptop is a Thinkpad T61p with dual-core at 2.5Ghz and a Quadro FX570M with 256Mb) My first and safer solution was to use a WriteableBitmap which works good but no 60 fps here, What do you suggest ? Shall I go WinForms for required performance ?   Thanks for your help !

SharePoint memory leak (8l1n)

hi , I'm annoied with the memory leak problem these days. the following text is copied from the ULS log. Does anyone can read this?  or pick up some clues out of it?

it's high appreciate for your help!

8l1n High     An SPRequest object was not disposed before the end of this thread.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  This object will now be disposed.  Allocation Id: {BE9269D2-BE0D-4A94-BBD9-71FD642892F2}  This SPRequest was allocated at    at Microsoft.SharePoint.Library.SPRequest..ctor()     at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)     at Microsoft.SharePoint.SPWeb.InitializeSPRequest()     at Microsoft.SharePoint.SPWeb.EnsureSPRequest()     at Microsoft.SharePoint.SPWeb.get_Request()     at Microsoft.SharePoint.SPListCollect... 
09/21/2009 13:16:35.11* w3wp.exe (0x1780)                        0x13D0 Windows SharePoint Services    General                        8l1n High     ...ion.EnsureListsData(Guid webId, String strListName)     at Microsoft.SharePoint.SPListCollection.EnsureListsData(String strListName)     at Microsoft.SharePoint.SPListCollection.ItemByInternalName(Strin

running SharePoint 2010 and on the server w3wp.exe is consuming huge amounts of CPU and Memory bring


I'm running Server 2008 (64bit) with 8Gig of RAM and 4 processors.  We haven't had more than four people in Sharepoint at the same time and performance has been extremely poor (had moments where things run ok but it usually doesn't last for more than a few minutes).  We're not even doing anything advanced.  Just a very small document repository with basic searching.

When I log into the server I can see several w3wp.exe processes running and will spike up to 100% of the CPU.  Memory will be around 100-800 Mb for each process.

Any ideas on how to speed up SharePoint 2010 performance?  Our SharePoint 2003 box runs MUCH faster and has 100+ users and over 3000 documents???



Workflow Designer 4.0 Load() Performance Issue: possible memory leak?


Hello everybody,

I am trying to implement a workflow designer in a windows form application and use the same designer to view different workflows. However, I found the program became slower and slower after loading several workflows.

my steps are as follows:

1. create a wpf user control WFDesigner to package the workflowdesigner;

2. In the user control  WFDesigner , implement a InitiateDesigner method which create a new workflowDesigner instance each time called. I suppose the old workflowDesigner instance would be collected by GC;

3. create a winform application and install the user control created on step 2 to an element host, and put the element host on the form. 

4. add two buttons for test: one will execute  WFDesigner.InitiateDesigner() once and the other will execute it 100 times.

ResXResourceReader memory leak?


I have occasion in my program to compile some CSharp code on the fly, with embedded resources from a .resx file. To do this, I use a System.Resources.ResXResourceReader to read the ResX file and a System.Resources.ResourceWriter to create the binary resource file. However, when I step through the code, I find that ~15MB of memory gets taken up when the ResXResourceReader reaches a Node whose value is a Bitmap, and that memory doesn't get freed even if I explicitly dispose the Bitmap. The ResXResourceReader is getting disposed (it's declared in a using statement). How can I keep this memory leak from happening? Here's the code where I read through the ResX file:


using (System.Resources.ResourceWriter Writer = new System.Resources.ResourceWriter(FileName = System.IO.Path.GetTempPath() + ClassName + ".resources"))

using (ResXResourceReader ResXReader = new ResXResourceReader(this.ResourceFileName))
                foreach (System.Collections.DictionaryEntry Node in ResXReader)

Is this a Memory Leak?



I am developing an app using the MVVM model and I am doing something which I think might create a memory leak.

Basically I have a master ViewModel which contains an ObservableCollection<Child1ViewModel>. Then, each Child1ViewModel contain an ObservableCollection<Child2ViewModel> and so on. I have 4 layers like that.

Each layer contains a reference to its parent. I added a "Delete Self" Command to Child2ViewModel, in a way that it removes itself from its parent's collection:

private void DeleteSelf()
  //First I delete the item through the model:

  //Then I need to remove it from the parent's viewmodel collection:

this.Parent.Children is the ObservableCollection<Child2ViewModel>. Since I am within the element I am deleting, when I remove it from the collection, will the garbage collector detect this and trash the object since the only reference to it was within the ObservableCollection? Or will it not kick in since i'm actuall

How to avoid memory leak when removing a tabitem with usercontrol as content



I am using tabcontrol with tabitems having usercontrols as content.

When I remove a tabitem, I can see that the memory is not freed. I saw this problem has been discussed, but I have not found a complete response. I tried to do in this order, as suggested in some discussions in the forum:




.TabControlTest.Items.Remove(ti); // ti is a TabItem

ti.Content =

Visual Studio 2010 Hangs in Designer, Memory Usage Grows


After switching to the web designer, VS2010 sometimes hangs. If I look at the Resource Monitor, I see that devenv.exe is consuming 50% of the CPU (on a dual-core machine), and its memory usage keeps slowly growing. Since VS is unresponsive, I end up killing the devenv process and restarting VS.

The problem occurs about 1-3 times a day. I have not found a way to specifically reproduce the problem, but it appears to happen most on complex web pages that include UserControls. All pages in this project also use Master pages, if that helps.

Since upgrading from VS2008 to VS2010, I've noticed a number of odd problems. This one actually forces me to kill the devenv process and restart VS2010, and so is particularly disruptive. I did not have any similar problems under VS2008.


Windows 7 Pro 64-bit, under Parallels Desktop 5, running under Mac OS X 10.6.5

Visual Studio 2010 Pro, version 10.0.30319.1 RTMRel

3 GB RAM allocated to the Windows virtual machine.

I'm not running any add-ins or other unusual software. Any suggestions?

(I have an annotated screen shot if it will help)

Memory leak in .net framework


Hi All,

is it possible to have memory leak in .net framework.If we are using any unmanaged code then there is a possibility, but what if our application is complete a managed application.Is there any chances of memory leak in case of managed code and if "there is a chances" then Can you please explain me how is that possible.Thanks for any help

VS 2010 - Attempted to read or write protected memory


Hi, My website used to run perfectly with out any error.

All of a sudden now when I am running under VS2010 it gives the below error

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

here is the detailed exception

System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
       at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
       at Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket)
       at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)


But whe

VS 2010 forcing Shared Memory


I have just installed VS 2010 Pro and I already have SQL Server 2008 all on Windows 7 Pro.  My db instance is set up for remote connections and I have enabled both Named Pipes and TCP/IP.  I've opened my firewall to 1433 and UDP 1434 for SQL Browser.  From VS 2010, in Server Explorer I'm able to connect to my instance and a database just fine however when I try to add a new SQL item to my project in Solution Explorer it throws the error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server.  The server was not found or was not accessible.  Verify that the instance name is correct and that SQL Server is configure to allow remote connections.  (provider: Shared Memory Provider, error:40 - Could not open a connection to SQL Server)

Why is it forcing the connection through Shared Memory?  But also, why am I able to make a connection just fine elsewhere?

Thanks for any assistance,



ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend