Is There Any Real Advantage To Run A GC.collect After That Our Application Has Used A Large Quantity Of Memory Or It Is Just A Psychological Factor?
Jun 29, 2011
is there any real advantage to run a GC.collect after that our application has used a large quantity of memory or it is just a psychological factor?
View 17 Replies
ADVERTISEMENT
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
Jun 10, 2011
I have a routine that is supposed to grab all email addresses within a certain group. The email address list can be well over 1000 emails. When emailing it out though I can only send around 150 emails at a time. So what I i've done is executed a query and threw all the emails into a collection.
How do I now reiterate through the collection grab 100 addresses each time and call the routine to email that group?
Dim emailToGroup As String = ddlEmailTo.SelectedValue
Dim connStr As String = ConfigurationManager.ConnectionStrings("SNA_TRT").ConnectionString
[Code]....
View 1 Replies
Dec 10, 2009
I have a windows app (2.0 framework) that's about 860k in size, just a small db app with a couple of data entry screens and a few reports (Cystal) I noticed that when the app starts the mem usage according to task manager is ~11,000k viewing just one report jumps the mem usage to 56,000k. i thought i could reclaim some of that memory by adding some GC.COLLECT() callls, but no luck. Mem usage stays the same in task manager.
So I made an even smaller test app with two forms....Form1 has two buttons , button1 Opens Form2, and button 2 calls GC.COLLECT()
From 2 contains a datagridview and 1 button. The form load for form2 executes the fill for the dataset that populates the datagridview and the button on Form 2 closes the form.
Here's the code for each form....
CODE:
No matter what I've tried so far I cannot seem to reclaim mem that gets used.
View 3 Replies
Jan 29, 2011
I have an application (i've been working on for a long time) that has many tabs and controls and quite a few components And a good deal of design code. And a list box that has around 100k items (i had to put a loader to pass the 3-4 seconds while its loading to prevent it from not-responding)I had a few Gc.collect calls in specific places (mostly after many items are added or removed). When my application loads, i call GC.collect only once at the end of the load. The program consumes around 35K memory by the time its loaded. However, i decided to mess around abit (don't worry i made backups)First i started putting gc.collect in some random places, and to my surprise the memory upon loading was observably decreasing. Then I went ahead and put a macro that puts GC.Collect before every End Sub, Exit Function, Exit Sub, and Return value, there is. Basically every block in my application had atleat one GC.Collect.
I fixed some 6 or 7 silly replace errors and compiled. When the program launched, the memory used at the end of launch was 21K!
At first glance that seemed great, but then i realized switching between tabs was VERY glitchy. and adding new lists took around 10x more time than usual (the loader stayed on for around 20 seconds!) And even though the memory looked good, the program was useless like this.Then i decided to mess around differently. I removed GC.Collect from the entire solution. It was no longer called even once.At first glance, when i launched the app it consumed just under 60K memory. That seemed terrible. However i realized something: even though my program in that state showed on taskmanager that it was consuming alot more memory than usual, it seemed like it was lighter than ever! Switching tabs was faster than before, especially every time i go to the tab that has the listbox control with 100k items. Loading items took around 3-4 seconds, but there was no stutter when the list finished loading whereas before it had an evident 0.3s stutter after the items were added.
This was all surprising to me because i thought GC.Collect was first of all, something that it doesnt matter where or how many times you call it. I thought it was just something that should be called at the end of work and i didnt think it would matter if it was called during work.Second of all, i thought GC.Collect only affected resources that are inaccessible, or resources my program is done with. How come the application feels faster when i don't call it?Third of all, i thought the VB CLR does most of the memory cleaning for me, and that GC.Collect was somewhat of a redundant command. It didn't seem so redundant to me at all considering the difference between using it heavily and not using it at all was around 38K in memory usage!
So i guess my questions are:
1) Do I need to call GC.Collect? WhereWhen do i call it?2) Why does calling it affect performance? And where does one draw the line between that memory stat on taskmanager and the program's performance?3) I also decided to run a small test. Why does a blank vb form application require 10K memory? How accurate is that stat shown on the task manager?
View 3 Replies
May 1, 2012
I have a problem with an application, in this case I have a windows services. its function is generate reports depending of demand of our users.In some cases the memory usage of my windows services is to 2 gb of RAM. I disposed all objects that my application use . but the memory usage doesn't low.I tried to reduce the memory usage forcing to garbage collector to Collect with the method "GC.Collect"but it's not recommend because uses many time of CPU.Surfing on the internet I found a method named "SetProcessWorkingSetSize" that free memory usage correctly. http:[url]....but some cases my windows services named sapdkadm_procesoestandarejecucion.exe has some error message in event viewer is the next:
Faulting application sapdkadm_procesoestandarejecucion.exe, version 1.0.0.0, stamp 4f908fef, faulting module kernel32.dll, version 5.2.3790.4480, stamp 49c51cdd, debug? 0, fault address 0x0000000000027ded.
The real problem is that when this happens my windows services restart
View 3 Replies
Jun 22, 2010
Ok so i have an jpg image of around 8.10mbs at around 13424 x 11344 pixels, i need to load the whole image in to a scrolling picturebox, is they anyway to do this without using so much memory for example like what google maps does n cuts the image down and some how stitches it all back to gether?
View 1 Replies
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
Dec 31, 2008
I'm loading an image, then getting size and such info from it, and loading the image into a picture box. Now it works and all, but I noticed it uses a large amount of memory. I'm doing: img = Image.FromFile(file)Where I load the image, 'file' being just a string containing path to an image on the hd. After that, I get the size and frame count (if any), and load it into a picture box: The image I've been testing with, is a 6600x5100 3.5MB JPEG, which can be downloaded from url...Watching task manager, when the app loads the image, it takes up about 104MB of memory. I've tried doing img.Dispose after the above line, but it brings up an error. If I put a button on the form with img.Dispose in it, and click it after app has loaded, it drops down to about 6MB of memory used. Loading the image directly into the picture box using .Load or .LoadAsync, after disposing img beforehand, still ends up with a huge amount of memory used.
So I'm wondering if theres a way to check if the picture box has fully loaded the img, so then I can Dispose the img and free up the memory. Or maybe a better way all together of loading an image into a picture box, and/or getting size & frame count, without having to use up that amount of memory before freeing.
View 2 Replies
Mar 11, 2010
i want to create an application that collect data from the rs-232.Someone have a code example with multi rs-232 in thread .I have one pc that have mapping virtual com.
View 1 Replies
Feb 18, 2010
I am retrieving a large BLOB and keep getting an Out Of Memory Exception. It occurs when I use a SqlDataReader to either check if the column is NULL, or if I try to read it and assign it to a Byte type of parameter, or if I use Response.BinaryWrite.
View 2 Replies
Aug 2, 2010
So, I have this code that grabs a bunch of data from the database, and performs a bunch of calculations on that data. However, this is not what is causing the halt. The halt is coming in when I take all that "final" data that has been prepared, and go to write that into a text file.
Each line in the text file is being created from data that has had calculations performed on it. Each line "corresponds" to a record from the database. A user will have to perform this file export usually on about 30-40 thousand records at a time. Now, even though I am using a StringBuilder, this still halts because of the pure mass amount of records.
What I do currently in the code is create one StringBuilder, append all the data (after calcs) to it, convert it to a String, add it to a List(Of String) to be returned from the Function, and then clear the StringBuilder, and do the same for the next row, and I do this until each row has been created and appended, converted, and then inserted into the List.
Then, another class receives this List(Of String) and takes each String and eventually appends it to a file.
Does anyone have an idea of how to improve this code and make it so it doesn't halt the server every time? The reason it wasn't found out until now is because when I tested it locally I was testing it on only 1-50 records at a time.
[Code]...
View 4 Replies
Nov 27, 2011
I need some guidance on a little program I'm making (one that I thought would take a couple of hours from start to finish, it's been days now ...) that determines all of the proper divisors of any given number up to the maximum value of a UInt32.
View 8 Replies
Apr 25, 2011
I recently wrote a program that collects information from the network can displays it in a DGV for the user to see. I tested this on networks where I would end up with several thousand items brought back and all worked fine, very little memory increase and once the search had finished the memory usage went back to pretty much what it was before the search, so I assume I have no major memory leaks that I should be concerned about (I'm careful to always dispose of things and clear large variables where possible).
However, a new company has now started using my application and they have several hundred thousand items that my program will find. They reported that they leave the program running its search for a few hours and most of the time it crashes with an Out Of Memory exception. Now I did have my app do some caching of certain information to avoid querying the network more than was necessary so I thought well maybe this is what is causing it but I added an option to turn that off and they say it still happens. So the only thing I can see it being is simply the amount of data that the program is finding and having to store in memory.once my application has gathered information about the items it stores them in a List(Of MyItemClass) and then when the search is complete the items are added to the DGV. So I'm thinking maybe its just the size of this List(Of MyItemClass) that is simply getting too large. Bear in mind that each instance of MyItemClass in this List can have quite a lot of information in it as it has several properties that are List(Of String) that may contain a few thousand strings in some scenarios.How do you deal with such large amounts of data without running out of memory?I'm assuming the only option I have got is to 'page' some of the data to a temporary file on disk once I get over a certain number of items in the List(Of MyItemClass)?
View 2 Replies
Feb 24, 2012
I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1. BACKEND1 will be running on a SERVER when this gets ready for production use. Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.
On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files. Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on. Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK? Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?
My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much. just looking for opinions. I guess ultimately I'll have to bench mark this myself in a production environment to get a real answer.
View 1 Replies
Sep 19, 2009
I seem to be having some issues with my code here. The sub "CheckSettings" is actually run off of a system timer, so that every 5 seconds it calls CheckSettings (actually, i set it to every 1 second for debugging, so i can see the leak a little more clearly by monitoring the process). CheckSettings basically checks to ensure there isn't already an instance of the thread running, and if there is, it checks to ensure that the instance has completed running ... once it has the go ahead, it creates a new thread and runs again.
code:
This code is creating a very large memory leak. After a few minutes of running, my application goes from a memory footprint of about 45,000 K to about 1,000,000 K. Quite the leak. I read some articles on the managed versus unmanaged memory etc, and I was careful to free the objects etc.
View 3 Replies
Sep 28, 2010
I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1.BACKEND1 will be running on a SERVER when this gets ready for production use.Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.
On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files.Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on.Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK?
Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much.
View 2 Replies
May 19, 2010
I am facing an amazing problem in my application. On my Developement server when I am running my application, then there is one function where I am trying to put whole stringbuilder contents in a string object. This Function is used for paging the reports.For that I am using a method of Stringbuilder.tostring() and when I chek the value of this statement (stringbuilder.tostring()) it shows no such interface is supported, which later on throws exception of system is out of memory. Here i am using .net 2.0 framework and sql server 2005 database.But when I run the application on stagging server then there is no such exception thrown.[code]
View 3 Replies
Jan 12, 2011
how to find the factor of a number using textboxes and arrays? i dont seem to understand the whole layout
View 2 Replies
Nov 13, 2009
So far I have made a program that can find all the factors of a number (e.g type in 24 and you'll get 1 * 24, 2*12, 3*8, 4*6,). What I would like to do now is add a check box (called Show_Prime_Factors_chk) that when checked it will also show all the prime factors below all the normal factors.
View 2 Replies
Apr 20, 2011
Is it possible to make an app (with VB.NET or any other language) that actually listens to real FM? not internet radio, or XM Radio, or any of that, but actual (Signal) FM radio, the type you listen to in a car or with a radio? if it's possible, is there any special hardware that's needed? I mean, if i wanna make it will all the consumers be able to run it? or only a selected few? Im sorry if this question is too long...
And is radio dead now or is that what people say? Am i the only one that stil listens to radio?
View 2 Replies
May 2, 2011
I am starting a new project in VB, a card game modelled to be similar to a real card game.
I have the majority of the program planned out and have even started coding parts of it; my problem comes with the networking.This is a real-time card game (not turn-based) and I want to be able to play with real people (family mostly, so over LAN is what I'm after).
I have tried searching for code samples but I everything I have found seems more complicated than I feel is required for the task, introducing a lot of new concepts and not explaining them.
What I'm after is a simple way to exchange the information in real-time, I don't care so much for efficiency (at the moment) just ease of use - though if I need to wade through a heap of documentation I will. A perfect answer would tell me what the names of some of the controls/methods that would be appropriate are, even if it just re-affirms a bit of the complexity, you do not have to detail anything if you don't want to I just feel a bit at loss as to what exactly it is I am looking for!
View 3 Replies
Jun 15, 2011
I've use VB net to create a application that can download the real-time data from a device for every second. Now I want to upload the data to a website in real time. (So some who is far away, can also check the data through the website)
View 3 Replies
Feb 18, 2009
I would to create an application that will allow me to monitoring in real-time the screen on a remote computer, I dont want to keylog, or control mouse,ot keyboard, just watch what they do at real-time.
View 6 Replies
Mar 17, 2009
I have a large financial application which I am migrating to VB.NETIt has two main components: charting and financial statements.I want to know if it is possible (and how) to create a main exe, and then two separate projects for the two components (as dll's?).
View 3 Replies
Feb 8, 2011
Building a large application using 3 tier architecture in vb.net. Question: I am a vb.net developer. I have developed small and medium size application with 2 tier architecture. Now I am going to develop a large application. I have decided to develop that application using 3 tier architecture. So I studied about 3 tier. Now I know how what is 3 tier and how to develop a simple application. And also I studied about .Net Remoting and Web services. In my project, 7 modules are available. Each module has 3 layers. How can I manage in a Single Solution?
View 1 Replies
Apr 30, 2011
im considering to study properly 1 of these two languages because in vb.net the limitations ive encountered were not very significant, and C# because i hear all ppl shouting at how vb express is for newbs and how C# is the way to go..What i would like to ask is, what is exactly the main advantage of C# over VB Express because what ive read from wikipedia, the only difference is the language, while C# might have 1 thing or 2 extra to vb express and vice versa...[URL]..So, could anyone clear me up please? i would really like to know if vb express is really worse than C# or the differences are only in syntaxes.
I personally used to hate VB Express at the begining but now im fastly changing my mind so im more inclined to this language, but i dont wanna wake up in 3 years realising ive been wasting so much time in a language that isnt as good as "the competition", get it?
View 20 Replies
Sep 2, 2011
I have a litlle idea about for the sql parameter. I need other explanation why using sql parameter and what are the Problem not using sql parameter.
View 10 Replies
Apr 21, 2009
I am trying to build an application using vb.net that will serve as a very large checklist of sorts. and i'm not exactly sure of the best way to do this. I considered using a database but i would need it to be self contained without having to rely on a server or internet connection
View 4 Replies
Apr 11, 2012
As quick solution to the user wanting to be able to open a particular form from any other form (in a large application with many forms, not an MDI app), I added KeyPreview to each form and corresponding KeyPress event so that said form will open (ShowDialog) upon pressing F12 from all these other forms.
Since this update has been in place, the user has been getting intermittent (maybe 2 or 3 within the course of a workday) but nasty errors such as "exception has been thrown by the target of an invocation" and the dreaded "out of memory". Is there reason to believe (off the top of your head) that the KeyPreview could be causing this?
View 1 Replies