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


ADVERTISEMENT

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

VS 2010 - Program Memory Leak, Ram Gradually Increases

Nov 25, 2010

I'm trying to fix a problem that is just killing my program's efficiency. When I run it, it starts out at maybe 10M of RAM, but it gradually increases. Within 20 minutes, it can get up to 700M of RAM. Now, when the program is restarted, all of this goes away and starts anew, but restarting the program every so often is a very loose solution. Here's what my program does: there's an array in which many (anywhere from 500-4000 or so) links are placed. I have a webbrowser that navigates to each of these and does an action on them, then moves to the next page. For example: [Code]

And all of the actions work perfectly, but the memory exponentially increases, resulting in a crash if left on for too long. I've searched Google and all I've found is that that's not the actual usage, and that if you just minimize it and maximize it again it will go down, but it did not when I tried it. Why is the memory increasing so much like that, and is there any way to fix it?

View 7 Replies

Memory Leak In Program - Server (Windows 2003) Is Crashing?

Feb 5, 2010

working on an application which performs a set of operations on Active Directory based on an op code.The application was developed long back and has been working fine. I recently made few changes, which is causing the Server to run out of memory whenever the program is being run. I also modified the code to make sure that the variables being declared in each function are set to "Nothing" at the end of function so that the memory can be collected by garbage collector. To make sure, I'm also forcing garbage collection to take place at different parts of the program. But, I still continue to have the issue. The program is very big and hence I could not upload it.

The code retrieves a list of rows from a table with opcodes in it and based on operation code, it performs a set of tasks. The problem is that when it loops through each row in the table, the size of memory required by the program keeps increasing (> 1 GB) to the point where the Server (Windows 2003) is crashing. I have tried different profiling tools, but none of them have been able to detect any memory leaks in the program. I'm guessing that the resources are being held up and hence causing this issue.

View 7 Replies

Program To Detect Change In Selected Pixel On Screen - Memory Leak

Mar 21, 2011

I am fairly new to visual basic and have written this program to detect a change in a selected pixel on the screen. When the pixel changes, a sound plays every x seconds. It works fine but after a few hours of operation a possible memory leak causes it to either crash the program or the PC. I have watched the process and I can see 4k added to it every 4 seconds or so. Where this memory leak is coming from?

Here is the code:
Public Class Main
Public pointx As Long
Public pointy As Long
Public areaselected As Integer
Public TimeToPause, SecondTimer, changefound As Integer

View 10 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

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

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

Memory Leak In A Very Large ASP.NET Application

Jun 17, 2012

I have a problem with a memory leak in a very large ASP.NET application. After about 24 hours of usage (sometimes a lot more) an OutOfMemory exception is thrown. Therefore I am trying to understand how managed memory works in .NET. When does an ASP.NET application throw an OutOfMemory exception? The server has a lot of RAM and there is always plenty of memory left when an OutOfMemory exception is thrown. I understand the difference between virtual memory and physical memory. How much memory does the W3WP process have to consume before an OutOfMemory exception is thrown? Is there a setting somewhere e.g. in the Machine.Config file? The ASP.NET process is never recycled.

View 2 Replies

Memory Leak In File Reader

Nov 19, 2009

I'm currently coding a file reader for fixed-width tables in VB, and the compiled application seems to be sucking down memory like there's no tomorrow. I'm working with a series of ~50 megabyte files, but after running through several, the process starts taking up about 200+ megabytes of RAM, which is way more than it should.I've done some poking around, and I think the issue is the call to NewRow(), but don't take my word for it. Does anyone have some tips for optimizing this? If the problem's with the NewRow() call, is there a way of clearing this out? [code]

View 1 Replies

Memory Leak In Large Array?

Feb 12, 2010

I need to improve memory performance on my application and I could see that I have problems with memory fragmentation.I've read an interesting article on large objects from Andrew Hunter of Red Gate, and one of the solutions he recommends isow do I implement his suggestion in my code?My program has a very complex form (with an object that leaves residual memory every time it opens. I found a complex list that may be the culprit, and I'd like to implement his suggestion to see if it fixes the issue.

View 1 Replies

Memory Leak In Simple Routine?

Nov 11, 2009

I have a service that i believe has a memory leak in one particular sub routine but I cannot find out why.The routine writes data to an opc server every second. It receives a command via tcp, connects to the database for verification of signals and writes the data. When it completes it writes a message back. I am disposing of everything i can think of but for some reason when I check it in the morning then memory has increased dramatically and the cpu usage goes up to 50%. this only happens to the service when I start the client application that sends the data so i know it has to be in this routine.

[Code]...

View 9 Replies







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