trekkie25

Steps to reproduce the problem I describe:

1) Create a new project
2) Go to the Resources Tab and "Add an existing file"
3) Ctrl-Alt-Del to open active Processes in the Windows Task Manager
4) Watch devenv.exe
5) Add a jpeg, bmp, whatever in the Resources Tab in VS 2005
6) Watch the memory usage creep up in the Task Manager
7) Keep adding files
8) At some point a threshold is reached and the system crashes VS Studio 2005 with an
OutofMemory Exception being thrown.




I tried creating a new project and the error is not present with adding the first embedded resource (i.e adding one jpeg file won't do it).

A new project consumes 120,000K in Task Manager and embeds files fine.

I added a file, this drives the mem usage up to 134,000 K in Task Manager.

#2: I then tried embedding a huge file (7MB) and rechecked: 193, 464 in Task Manager
#3: Added a third file (1.1 MB) and mem usage goes up to 272K.
#4: Added a fourth file (300K) and mem usage now 312K.

This is eventually what throws the exception.

It appears that as you keep adding files to embed, the mem usage in Task Manager for the devenv.exe keeps creeping up until at some threshold value an OutofMemoryException (at what point depends on your system RAM configuration) is thrown. I believe this is the issue I am running into.

In the problem project I have over 40 images and the mem usage of the devenv.exe in Windows Task Manager is over 500,000K. I have 1.5 GB of memory in an IBM ThinkPad.


Neil


Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

Spidermans_DarkSide - MSP, VSIP

Hi,

Instead of adding loads of picture files or whatever, why not load them, one-at-a-time as and when you need them

That should keep the memory usage down.

Surely you are not using the added files all at once

For example if you have a set of pictures as;

1.jpg

2.jpg

3.jpg

4.jpg

etcetera in your Pictures folder then try this. Add just 1 PictureBox to a FORM.

Just click on the picturebox to see the picture change.

I just tried a solid red square as 1.jpg, a solid yellow square for 2.jpg etcetera.>>

Public Class Form1

'This should read as one line of code in your code window.>>>>

Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

Static pictureNumber As Integer

pictureNumber += 1

Try

'This should read as one line of code in your code window.>>>>

Dim filename = "C:\Documents and Settings\yourUserNameHere\My Documents\My Pictures\" & pictureNumber.ToString & ".jpg"

PictureBox1.Image = Image.FromFile(filename)

Catch ex As Exception

MessageBox.Show("File not found!!")

End Try

End Sub

End Class

Regards,

S_DS






Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

trekkie25

Thanks,

That is a good solution and I have decided to go to that route. I am not using 40 pictures at once, I was just trying to package certain jpegs and icon files as embedded resources. For example a "send email" icon on a custom email form. What is easier is distributing a folder on the client machine with all the necessary pics and just loading them as needed. You are correct that this negates the memory issues. I was simply trying to see if the "embedded resource" method of distribution could handle a large number of embedded files.




Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

Spidermans_DarkSide - MSP, VSIP

trekkie25 wrote:
Thanks,

That is a good solution and I have decided to go to that route. I am not using 40 pictures at once, I was just trying to package certain jpegs and icon files as embedded resources. For example a "send email" icon on a custom email form. What is easier is distributing a folder on the client machine with all the necessary pics and just loading them as needed. You are correct that this negates the memory issues. I was simply trying to see if the "embedded resource" method of distribution could handle a large number of embedded files.

Hi,

Why not put your files in the Bin folder along with the .EXEcutable file instead

Regards,

S_DS






Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

Screamin Eagle

I'm having similar problems, but just with the IDE in general. After opening up the IDE and loading a solution, I notice that the memory commit usage starts to rise significantly without any interaction with the program. With the application open a matter of minutes, the commit usage goes from a manageable 50 megs to a mind blowing 500 megs, with no interaction whatsoever on the IDE.

Any help would be appreciated.

Thanks...





Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

MilesKelly

I have a similar problem. Eventually devenv.exe will bog my computer down. I have to restart after a few hours of development. Other people on my team (looking at the same files from TFS) do not seem to be having the problem.






Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

ATRIP

This solution does not work for the memory creep problem. I can just new project or and old one and do nothing with it, and I can see the memory creeping.

After a few debug runs, I can see the memory reach 1.2 GB. from 12MB. Where can I find the actual solution to this problem





Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

Sarika_MS

Hi,

Can somebody please send their solution or steps to reproduce this issue I can set up a ftp site if the solution is big.

Please contact me at vbperf@microsoft.com

Thanks,

Sarika






Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

patnocera

Hello Sarika,

I am also experiencing the same problem. I have a simple program where I can select a image file from a listbox and and load the picturebox. I have noticed that each time I click to open a file, I can see my available memory decrease and my application memory increase by roughly the size of the file. I tried to dispose of the picturebox resources, thinking that would release the memory, but it had no effect.

I also considered the GC might be a little slow and tried waiting with no effect at all. Next I also tried to run the executable outside of the Visual Studio, but again the memory leak remained exactly the same. Finally, I commented out the picturebox and the leak disappeared (along with my image).

Thanks,

Pat




Re: Visual Basic IDE Is there a memory leak issue with Visual Studio IDE not addressed in SP1?

Sarika_MS

Pat,

Sorry for the delay. This looks like a bug. I would reccomend you to log is via Connect site. The url is:

http://connect.microsoft.com/VisualStudio

After logging this issue, please send me mail at vbperf@microsoft.com and I will make sure that it is routed properly.

Thanks,

Sarika