VS 2008 Memory Leak In Short Function

Nov 9, 2009

I have this relatively short function, triggered when the mouse is moved over a picturebox. When being called, it slowly increases the RAM and PF usage of the program which never recovers.[code]I just wanted to report back and say that I did solve this issue (more or less).I added a manual garbage collection call at the end of the loop and it kept the resources usage under control. It did seem to slightly slow the response time, but it's worth it to avoid the program hogging multiple GBs of RAM.

View 1 Replies


ADVERTISEMENT

.net - Sendasync Mail Function Potential Memory Leak?

Jul 21, 2009

I have that code running into a windows service and the service seem to have a memory leak, something is wrong for sure. After looking at the whole code, I think it might be inside one of these function but I cannot seem to find where it could be.

[Code]...

View 1 Replies

Function For Plotting A Graph - Facing A Memory Leak?

Aug 10, 2009

I found this function for plotting a graph online somewhere. I am pretty sure it has a memory leak but cant figure most of the functions as I am new to VB and windows API. Looking for some quick tip on what I should be looking at.

[code]...

View 7 Replies

VS 2008 Finding A Memory Leak?

Jan 1, 2010

I'm trying to work out a bit of a memory leak and was hoping someone can assist. The below program is running fine except for one thing. 1. The memory leak. When I run the program and watch task manager, I can see the memory usage of the program starts at roughly 14 meg. Over a period of hours, that increases pretty substantially. Eg. at 6am this morning, it was at 14 meg, and by 3pm it was at 36 meg.In a nutshell this program takes an incoming stream of data which looks like this.

MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.441,2007/02/24,11:03:35.829,,33975,,,53.82440,10.19830,,,0,0,0,0
MSG,3,51,673,44CE6D,1429,2007/02/24,10:58:35.098,2007/02/24,11:03:35.829,,39000,,,53.87798,9.88422,,,0,0,0,0
MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.848,2007/02/24,11:03:36.829,,33975,,,53.82353,10.19696,,,0,0,0,0

It basically parses the stream and places items into hash tables depending on the type of data. Eg. I have a hash table for latitude, one for longitude, one for altitude, etc.The key is always the hex code eg. in the first line above the key would be 461D3B.Essentially, as the data arrives in and is parsed and placed into hash tables depending on the type of data, I also have another hash table dedicated to keeping track of timeout times for that individual piece of data. The timer event fires and if the timeout is exceeded for that piece of data then it gets removed from all the hash tables.

I believe this is working. I've done heaps of debug output to the output window ensuring that items are being added to and removed from the hash tables successfully. Eg. ensuring that the hash table record count matches what I believe the number of active records should be.I'm at a loss what could be causing this memory leak though. I'm assuming i'm not disposing of an object properly, or not initializing/declaring it properly, but I can't work out what i'm doing wrong.One thing i'll mention though. The timer event occasionally comes up with a warning about the contents having changed during the For..Next loop. I don't think this will affect things though. As long as the hash table item count matches what it should be, I don't see that being an issue.

Imports nsoftware.IPWorks
Imports System.Data.SQLite
Public Class frmMain

[code]....

View 14 Replies

VS 2008 Unbinding From A DataGridView, Memory Leak?

Oct 12, 2009

Using VS Express 2008 and .NET2.0.

I have a DataGridView which has as its .DataSource a BindingSource, which in turn has its .DataSource set to a BindingList<> which contains some classes. All works well, and I potentially have a list of several thousand items, and hence several thousand rows on the grid. When I wish to disconnect binding, clear the list and hence clear the grid, I am setting the grid DataSource property to Nothing, and calling .Clear in the BindingSource.

However, it appears that when I do this, the memory usage (Private bytes) does not reduce until TWO full GC's occur. (Both metrics checked with PerfMon.) I can only surmise that the original row instances in the grid are hanging around and making it on to the Finalizer queue perhaps?

Is there anything I can do about this, or is it expected behaviour? I'm not sure if setting the DataSource property to Nothing is enough to 'purge' the grid properly. Using Reflector, I notice that DataGridViewRow inherits Dispose from it's base class, so do I have to call this somehow, or should the act of unbinding do this automatically? (The classes in the list are purely managed, and have nothing that requires Dispose calling on them.)

View 8 Replies

Sockets + Windows Server 2008 = Memory Leak?

Jan 29, 2010

We have a small service shows continuous nonpaged pool bytes increase from the moment it is started. This is only on a 2008 server (all the others work fine).

The service basically connects a socket to a client to see if it's successful and then closes (most code omitted):

[Code]...

View 3 Replies

DirectoryEntry Memory Leak - Gets A Out Of Memory Error In The Last Catch Statement?

Jan 11, 2012

The follow code can be called about 6K times on the server it is run on then gets a out of memory error in the last catch statement. I don't see what is wrong with the code, it works well up until the out of memory..

Public Function AddUserToGroup(ByVal sSamAccountName As String, ByVal sGroupName As String) As Boolean
Try
Dim returnStatus As Boolean = True[code]......

View 3 Replies

VB 2008 Memory Leak - The Graphic Doesn't Dispose Properly And Garbage Collector Gets It?

Jul 7, 2011

I have prided myself in having a pretty clean code however in the game I am making I have a player view (showscreen) and a host view, which is a copy of the player view (on a smaller screen). This way the host can see what's going on.The problem is that the graphic doesn't dispose properly and Garbage Collector gets it, though I have noticed it will crash if GC doesn't get it in time. The larger the showscreen window the more junk gets put into memory, which sucks.I thought I had everything correctly disposed below but still doesn't get the job done.

[code]...

View 9 Replies

Memory Leak - After About 6000 Of 1,250,000 Images In ##X It Throws An "out Of Memory" Error

Feb 9, 2011

This code was put together for a one time run. It's purpose is to count all the pages in a group of images. After about 6000 of 1,250,000 images in ##X it throws an "out of memory" error. Besides it being thrown together for a one time run does anybody see anything obvious that could be causing the error?

CODE:

View 5 Replies

.net - Finding A Memory Leak Cause?

Feb 9, 2010

I have the following Leak situation in a VB.NET (.NET2) application: a form - DetailTache (TaskDetails) - in my MDI application is not garbage collected is not collected ofter open/close.

EDIT: Result search from projet of WinComboRowSelected Event. There are 3 usages of this word in application:

Declaration in Class WinCombo: Event WinComboRowSelected(ByVal sender... (only one)
Raising: RaiseEvent WinComboRowSelected(sender, (3 raisings)
Usage: ...e As Keolis.ctlWinCombo.WinCombo.WinComboRowSelectedEventArgs) Handles cmbProduit1.WinComboRowSelected (multiple handles).

there is No other usage of this event.

View 5 Replies

DataGridView Memory Leak

Sep 2, 2011

I refresh a DataGridView every second. It has about 50 rows. This ends up using the entire memory of the computer in about 1 day. I wanted to see what recommendations you had to clear up this memory leak.


The DataGridView1 is bound to a DataTable.
DataGridView1.DataSource = MyDT

View 7 Replies

DataGridView Memory Leak?

Jun 1, 2012

I refresh a DataGridView every second. It has about 50 rows. This ends up using the entire memory of the computer in about 1 day. I wanted to see what recommendations you had to clear up this memory leak.

View 4 Replies

Managed Memory Leak?

Jun 13, 2006

I am having a very strange memory leak that seems related to databinding. It is very hard to reproduce, so I won't post any code here to do so, but will just describe the problem.We have data entry forms which have controls which bind to custom business objects through a BindingSource object.

View 7 Replies

Memory Leak In .net Application

Oct 19, 2011

I am working on a desktop application in VB.net 2005. The application contains a timer with an interval of 1 min. Each time the timer ticks, a set of functions gets executed, mostly database related.Initially the application runs fine. In processes(Task manager) the cpu usage goes to 100% every time the timer is invoked. But the timespan is around 1 sec(negligible).However as the time passes and after around 20 hours the time span of timer_tick increases to something like 20-30 secs. In this period cpu usage is 100% and the application does not responds. Gradually the time span of timer_tick increases to 1 min and the cpu uses gets stuck to 100% and the application does not responds.All objects are properly disposed. Moreover, this issue is with pentium 4 processors. The application runs fine on core 2 duo.[code]Many Select, Update and delete queries are performed in the timer.This problem occurs when I am using around 7000 records in database.

View 2 Replies

Memory Leak In .net Application?

Oct 19, 2011

I am working on a desktop application in VB.net 2005. The application contains a timer with an interval of 1 min. Each time the timer ticks, a set of functions gets executed, mostly database related.Initially the application runs fine. In processes(Task manager) the cpu usage goes to 100% every time the timer is invoked. But the timespan is around 1 sec(negligible).

However as the time passes and after around 20 hours the time span of timer_tick increases to something like 20-30 secs. In this period cpu usage is 100% and the application does not responds. Gradually the time span of timer_tick increases to 1 min and the cpu uses gets stuck to 100% and the application does not responds.All objects are properly disposed.Moreover, this issue is with pentium 4 processors. The application runs fine on core 2 duo.

View 1 Replies

Memory Leak In Class?

Jan 12, 2010

This is a very simple UDP Listener class. I can add it to my applications and give them the ability to accept a text command from a UDP packet. I use it for simple, insecure, non-vital communication between a couple apps. The code as written here works--except it has a memory leak. The program's memory usage will slowly build until it crashes. I believe I'm doing something wrong with the way I do the udp.receive method or perhaps the threading? I was trying to keep it as simple as possible when I wrote this, but let me know if I'm doing anything wonky here.

[Code]...

View 10 Replies

Memory Leak In On Paint?

Dec 16, 2009

I created a simple application to display the current Date/time on a Form (see below). When the application runs, the amount of memory used continues to grow. I don't see any obvious problems. I am running Visual Studio 2008 on Vista Business OS.

[Code]...

View 16 Replies

Memory Leak In Program

Jul 11, 2009

This is a little app that sits in your task bar and check a website for the presence of a simple string. The string is either "ONLINE" or "OFFLINE". THe problem is that there seems to be a minor memory leak, since every once in a while (I suppose when the timer expires) the memory it takes up increases by a good bit. [code]

View 7 Replies

Memory Leak In Thread

Jan 29, 2010

[Code] There is a dispose part that is called just after it finishes processing (don't know if it works, but from what I read I should be disposing it? [Code] When I run it like the above, I have NO memory leaks. It works great. I can have it run for hours and generate everything I need without any issues at all. When I change it so the oThread(ThreadCntr).Start() is working and I comment out MQM1(ThreadCntr).RouteIt() it fails around the 400th thread call (keep in mind I only do 10 threads at a time) from using up too much memory. If I run it with oThread(ThreadCntr).RouteIt() commented and using MQM1(ThreadCntr).RouteIt is working, it will run forever without running out of memory.

View 1 Replies

Memory Leak In ToList?

Aug 6, 2009

I am having a problem with an application I have developed, there seems to be a memory leak that causes the application to crash when it fills up the RAM. I have a process that repeats for each row of a given table, while this process works fine there is one line in particular which converts the results of a linq .tolist which is never disposed of. Since this process is only able to be executed ~200 times before an outofmemory exception occurs.

How can I dispose of the instance of each class to clear this memory in between iterations, or failing this is there a particular area in which I can look further to solve this problem?

View 1 Replies

SWbemRefresher - Memory Leak?

Nov 1, 2011

I am having a problem with a Windows Service I have written, if I enable a certain option I am seeing what I think is a memory leak. I've looked at trying to debug this using crash dumps (the app doesn't crash BTW, I create them using process explorer), .NET Memory Profiler and WinDbg but I am not getting far down to my lack of expertise with these products.

The piece of code causing the problem is below, if I comment the call to this code out, memory usage is fine. What I am seeing is the private bytes for the process going up and up and up. This code is called regulairly and after 24 hours the private bytes for the process are huge (say 2GB) wheras if I comment the call to this code out the private bytes remain at around 160MB, fluctuating up and down as expected.I am not entirely sure if I am disposing of everything correctly (I think I am) and I just cant find whats causing the problem.

Here is the code:

'//CREATE REFRESHER FOR OUR CPU USAGE
Dim intProcessIDPre, intProcessorUsage As Integer
Dim strProcessName, strUserName As String
Dim intPrivateBytes As Double

[code]....

View 9 Replies

WinForms App Memory Leak?

May 17, 2011

I'm using a WinForms App built with IdeaBlade and DevExpress ... It looks to me like the DevExpress controls are causing objects to persist in memory. I'm trying to find what is preventing the garbage collector from removing then with little success.

Can anyone recommend an analysis app that is good at finding what handler, etc is holding an item in memory?

I've used AQTime 7 Pro and .Net Memory Profiler, but neither of them seem to make it clear what is causing the issue.

View 2 Replies

WinForms Memory Leak

Jan 11, 2012

I'm trying to get to grips with how Windows Forms applications manage memory allocation. I'll give you an illustration of the problem. Take this simple winforms app which is a main form with two buttons: one that opens a form containing some random data, and another button that closes all open forms (except the main form) [Code] You can see the memory dropping at intervals (I've marked some of them above) which is good but it still slowly has a minimum that creeps up and up.

This is a very basic illustration of a much bigger production issue with a huge application with 100,000s lines of code and users that keep the app open all day. Over time they open and close a lot of forms and the memory creeps up. Is there any way to force the allocation down? I know I can force GC but this won't do anything as it's the memory post-GC that is remaining high as far as I can see.

This isn't a problem with references as far as I can see because I have spent some time experimenting with just one form in the main application opening and closing it and there are no references after it is closed and disposed and yet the memory still creeps up in a similar way to that logged above. Also if it was a problem with references, I'm not sure how that would explain my test app above.

View 28 Replies

.net - Memory Leak And Weak References?

Oct 27, 2011

I'm having an issue which looks like a memory leak in one of my applications (the application uses more memory over time, an after about a week of work it hangs). I've detected and fixed some leaks related to classes I've written (comparing heap dumps taken with sos.dll revealed them quickly), and those no longer increase in number.

Currently, the only thing that dramatically increases over time are WeakReference instances, which increase at a steady rate of 1,000 new WeakReference instances per minute.My code doesn't use WeakReference directly, I never create those myself.

What could cause so many WeakReference instances to be created? I'm using VB.NET, Visual Studio 2008 and .NET 3.5

View 1 Replies

AppDomain, WebBrowser Memory Leak?

Apr 23, 2011

I have done a lot of research on the memory leaks present in the WebBrowser control, and the following thread (http:url]...) told me that the only real way to reclaim the memory eaten up by WebBrowser is to load the control in a separate appdomain.I went ahead and did this, but when I unload the AppDomain that the WebbBrowser is created in (using AppDomain.Unload()), the memory is still not freed. I am looking at the Private Bytes of the process in Task Manager (which is accurate and what I'm interested in) to confirm this. The memory usage stays at 50MB+ instead of its default 5MB.Here is my code:

Form1.vb
Imports System.Reflection
Public Class Form1
Private ad_WBInst As AppDomain[code].....

View 6 Replies

ASP.NET - Concatenate String Memory Leak?

Jun 16, 2012

I am supporting an application, which uses lots of String concatenations and I believe this is the cause of a memory leak which eventually causes an OutOfMemory exception. Please have a look at the code below:

Public Sub ConcatenateString() As String Dim Test1 As String
Test1 = "Hello"
Test1=Test1 & "my"
Test1=Test1 & "name"

[code]....

I believe there are nine Strings in memory at line ten as String is an immutable object, but only one reference to the String Test1 that contains: "Hello my name is Joe Blogs what is yours?". My question is; are all of these Strings picked up by the garbage collector when they go out of scope? i.e. when the sub routine finishes running. I seem to have a memory leak and am thinking that I should really be using a StringBuilder object.

View 2 Replies

C# - Correct CryptoAPITransform Use - Memory Leak?

Mar 19, 2012

I've ported an old piece of unmanaged code that used Crypto API to 100% managed .NET code. The code used DES algorithm, and had to maintain it for several reasons. Since the CryptoAPITransform instances got from the CreateDecryptor and CreateEncryptor methods are marked as reusable, I thought of just creating an instance of them and use them whenever needed.

[Code]...

View 1 Replies

Create A Memory Leak In C# / Program?

Jul 2, 2011

Inspired from this question, was wondering what are the possible ways to create a memory leak in .Net. I once found one with ODBC Data Access. Has anyone had any experiences with latest version?

View 6 Replies

IDE :: Memory Leak In Windows Form?

Jun 14, 2011

I am a project analyst emrpesa software and recently in our systems. Net that are still
a minority began to System.OutOfMemoryException.

View 2 Replies

Memory Leak In .NET Screenshot Application?

Oct 6, 2009

screenshot application I am developing that has a memory leak somewhere. The main code is as follows:

Public
Class Form1
Dim strPath As String = "C:windows empscreenshot.jpg"
Private Sub Main()

[code].....

The application runs from the system tray and a clickevent handler for the notifyicon control calls the Main() sub. The code calls OutlookEmail() which creates a new outlook mail object. The problem is that each time the notifyicon in the system tray is clicked the memory in use jumps up incrementally - about 3mb each time.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved