VS 2008 Show App Memory Usage?
Sep 15, 2010Is there a way to make an application show it's own memory usage?
View 9 RepliesIs there a way to make an application show it's own memory usage?
View 9 RepliesYou can easily get the memory usage of the current process using workingset64 However I could not find any event like OnMemUsageChanged so I can display a little mem usage meter that displays live/real time the mem usage value. Updating in a timer every second can be done but looks inefficient. Is there anyway I can get an event or callback every time the mem usage changes ?
View 1 RepliesI've noticed that every time I start a new thread in my program, the memory usage jumps about 1000k and it never goes back down. I have ensured that the thread is no longer running, and only one instance of my worker thread is ever running at a time. I am using ThreadPool.QueueUserWorkItem and ASyncOperation to get stuff done. The program starts using a Sub Main in a module that uses STAThread; I read that using STAThread instead of MTAThread makes it impossible for the Garbage Collector to get in and consider objects for garbage collection. However, when I change the STAThread to an MTAThread, the WebBrowser control in my frmMain cannot be instantiated.
I get this exception:
Code: An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll
Additional information: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. I do threading with the WebBrowser control, so will using MTAThread fix my problem? If so, how should I partition my code so that the WebBrowser control won't be affected by the above exception? I call the thread repeatedly with a timer (although only one instance ever runs at a time), and my program's memory usage starts at about 5000k and can jump to 300,000k+ depending on many times the thread needs to be called.
i am a beginner in vb.net programming...started a project in it.Below is the breif project description.The application is to ensure the integrity of the files.Following are the majors things that i have to implement
1. To browse the files from the disk on runtime.initially i am just taking the database files so it's basically to connect with the MS access db files.
2.To apply the different hash and encryption algos on the file.
3.To store the results on the hard disk back.
4. To calulate the performance of each algo using some performance matrix.(TIME,MEMORY USAGE etc)
Now i am having problem in two things.First in runtime connectivity with MS access batabase..and secondly and the main problem is that i could'nt find any appropriate builtin function to calulate the processing TIME and the MEMORY usage.
I've been having complaints about my applications that they use to much memory.Is there a way to make them use less?
View 11 RepliesHaving a problem with the amount of memory being used going up and up, and expanding until there is no memory left. I'm using the GHeat.Net plugin to build images. Here is the full code:
Dim pm As New gheat.PointManager()
Dim g As Graphics
Dim startZoom As Integer = 2
[code].....
i have two forms : Form1 and Form2..when i start application form 1 opens up, the memory usage is 10MB then i open form 2 and close form 1, the memory usage is 25MB.Again i close form2 and open form1, then the memory usage is 30MB.Why is this so that form 1 has different memory usage at different times...?
View 6 Repliesso im about half way through with rebuilding my fav project in vs2008 (old code was in vb6) and today was a great milestone for me as i got to test out all its limbs (whats missing is still the brain). Most of the code is completely new, even tho it has roughly the same structure .net framework has replaced the majority of api calls and everything has been reoptimized for performance.Now when i ran the complete systems check i was pleased to find that everything functioned without fail and the entire thing took only third of the time then the equivalent on vb6. What was shocking however was the memory usage when i popped open task manager i saw it hogging up to 4gb of ram and then dropped like a stone to 100k, again up to 4gb and down to 100k like a themepark ride the vb6 version never went above 46k so this is odd for me. While it doesent cause any direct problems on this comp, im afraid it might hurt the performance on the end system im going to run it on.
View 6 RepliesIs there any way I can get the memory usage for all processes currently running on a machine in vb.net?
View 1 RepliesI'm programming a windows services that is in charge of generate reports based to users request.for each user request I create a thread with next code:
hiloSolicitud = New Thread(AddressOf GenerarReporte)
hiloSolicitud.Start()
wherein GenerarReporte is a method that generate a report. I used threads because there are many users request.My problem is that when windows services has many users request the memory usage is to up 2 GB.that's the rest of memory possible, without count the memory for Operating System.In this case the windows services doesn't process any more request or reports because haven't more memory to work.so that when there are requests for large memory usage are processed but also allow the service of process windows of less use.I Want to limit memory usage for each thread.
I have a small-scale WPF application using VB.net as the code behind and I want to add certain features, but i'm concerned about performance.
1) My app interacts with a third party database to display "realtime" data to the user. My proposed method is to create a background worker to query a database every 30 seconds and display the data. I query about 2,000 records all long integer type, store them in a dataset, and then use LINQ to create subsets of observable collections which the WPF controls are bound to.
Is this too intensive? how much memory am i using for 2,000 records of long int? Is the background worker querying every 30 seconds too taxing? will it crash eventually? Will it interfere with the users other daily work (excel, email, etc)?
2) If an application is constantly reading/writing from text files can that somehow be a detriment to the user if they are doing day to day work? I want the app to read/write text files, but I don't want it to somehow interfere with something else the person is doing since this app will be more of a "run in the background check it when I need to" app.
3) Is there a way to quantify how taxing a certain block of code, variable storage, or data storage will be to the end user? What is acceptable?
4) I have several list(of t) that I use as "global" lists where I can hit them from any window in my application to display data. Is there a way to quantify how much memory these lists take up? The lists range from lists of integers to lists of variables with dozens of properties. Can I somehow quantify how taxing this is on the app or the end user?
Bitmaps and Pictureboxes, memory usage off the chart!???????????
View 7 RepliesI have started with a small project in VB2008 Express which grew to a complex application. I have deployed the application recently discovering it is rather small, and the major issue is that code-generated controls (checkboxes, comboboxes, textboxes) are not displayed as during development. I have declared the code-generated controls in the declaration region, and there are about 250 controls. According to user selection some of the controls are added to a container panel. Now, I am concern that because I declare those as public (static?) variables, it uses much memory and causes the problem in the compiled application. Is that correct that static declared and code-generated controls uses much memory? How to avoid it ? I need the controls as public variables. Is it better to add all 250 controls on the form in designer mode, and use the property Visible (control.visible=True)?
View 1 RepliesI am trying to setup performance counters for CPU Usage and Memory Used.I would like a progress bar and a label to display the percentage.I have the below code and although it seems to be half working, there is something just not right.. The memory one seems to be working fine although the CPU one is acting strange.
[Code]...
I saw some 'offsets' such as: 0x006E71A0and some that were like, Game.dll+8E336CI'd more so think the 0x006E71A0 and the Game.dll+8E336C are among the same format, so i'd like to use that.I have also read somewhere(this could be wrong) that the memory addresses formats are different between VB, C#, and C++.
View 2 Repliesi wanna know for example if you have a few functions that actually creates a new sqlcommand in it and disposes them after use or is it better to have an sqlcommand at the main function and pass the sqlcommand in byref . and after using it. Juz clear the commandtext and the parameters.[code]
View 14 RepliesI have a fairly complex application which makes use of an MS Access database. My application generates some 14million entries and inserts them after each generation, into the database. The app works perfectly without any bugs(that I am aware of) apart from one problem. If I run the app and let it run the full 14million odd data entries, the app crashes some way through and gives an Out of Memory exception.
I then loaded up TaskManager and notice that the memory usage increases by about 8-15Kb per second. I have done some reading and have tried using Dispose() to get rid of any objects finished with, I have tried building in release mode and the problem remains. I'm not even really sure if it is a memory leak or something else. I am using VS2010 and my application is running in .net 4.0.
I have an ArrayList that stores 100,000+ numbers inside of it. Each number is 10 digits in length or smaller. The program itself has data input into it, of which it loops through the user input to see if any of their numbers are already in the array using if ArrayList.Contains(userinput).
It would appear that when having an ArrayList of this size a LOT of memory is being used. Would there be a faster way to run this, E.g. Database or If TextFile.Contains(Line)?
Does a the size of the class affect the memory usage of the application? is it better to break big classes into smaller classes or just group them up into one big class.
View 2 RepliesI am trying to setup performance counters for CPU Usage and Memory Used.I would like a progress bar and a label to display the percentage.I have the below code and although it seems to be half working, there is something just not right.. The memory one seems to be working fine although the CPU one is acting strange.
Shared perfTotalMemory As New ComputerInfo
Shared perfFreeMemory As New PerformanceCounter("Memory", "Available MBytes")
Shared perfProcessorTime As New PerformanceCounter("Processor", "% Processor Time", "_Total")
[code]....
I'm having an unusual problem that I've never had with WR's before. I have a very user-driven program that interacts with a server of mine through webrequests. Depending on what the user's doing, it could end up sending a dozen requests/minute. This has never been a problem before, but for some reason system memory usage increases and doesn't stop increasing, as if something is cluttering it up for every webrequest that is sent out.
Is there a known problem with WR's like this? Or is it just a random screw up? I can get my system back up and running smoothly.
I check the memory usage of my project from task manager, It always increases when I open forms but doesnt decrease when I close them. So the memory usage is getting bigger and bigger...
View 8 Repliesfirst of all, I'm not 100% sure this is the right forum to post this, as there seems ot be tones and tones of forum branches here, so if I'm not in the right location, i'm creating an IDE for a proamming language and I need a way to monitor the physical memmory usage of a process tree. I'm not talking about the WorkngSet64 of a process, but the WorkingSet64 of the process and any child process started by it.
[Code]...
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
I have an VB application that I developed in Visual Studio 2008. The back end is SQL. Application stores quite a bit of information and gets updated daily by users. It also connects to AD to get u/p, adds new accounts in AD and adds mailboxes. Users connect to it through Citrix. We noticed big spikes in memory usage. The executable itself is less than 5Mb; if I run it and it opens main form - memory usage jumps to about 19Mb, open a report - it jumps to 80 Mb. If I open the form that is linked to multiple tables - it jumps to 157 Mb. Once users start pulling new information in, update it and connect to AD or Exchange - it could jump to 250 Mb. Also noticed that if user with read only rights has application opened and idle - memory usage constantly changes with a pattern
like 17Mb - 19 Mb - 15 Mb - 17 Mb and so on. This user wasn't even using computer at the time. In general - what could cause such jumps in memory usage? What is the best way to prevent it? On the server we have Windows Server 2003 SE
currently i am working on a project to help our customers troubleshoot our products, our products have the availabilty to be access via telnet, i can use the top command to show
top provides an view of processor activity in real time. This utility reads the status for all processes in /proc each <seconds> and shows the status for however many processes will fit on the screen. This utility will not show processes that are started after program startup, but it will show the EXIT status for and PIDs that exit while it is running.
I am looking to but this into my project in real time and show a graph do you think this can be achived ?
We have a .net win forms application, using .net 3.5. Application runs from a terminal server, users access it with Citrix client. when users run this app memory usage goes higher and hiher and it never comes back. even tough we put objects with dispose and set to nothing also the memory usage is not comming down. it starts wuth 75 mb and goes up to 500 mb. it is a 32 bit application.
how can we find the exact problem with the application. the bahaviour is almost same when we run our development box locally.
I cannot use Visual Basic 2008 at all. When I go to "new project" and choose "Windows Form Application" I get this error.I have tried multiple uninstall/reinstall with no result.A microsoft reply to this suggested that I needed: " .NET Framework 2.0 Service Pack 1 " I checked, and I did not have the .netframework 2.0 service Pack 1.
When I tried to download and install the above from Microsoft.com, the istaller said that "it was not allowsed" and I was not able to install the service pack 1.
I tried Uninstalling net framework 3.5, 3.0, 2.0 and then reinstalling .netframework 2.0 sevice pack 1; then reinstalling Visual basic 2008 express edition. At the reinstall of Visual basic 2008, .netframework 2.0 sevice pack 1 is unistalled by .net framework service pack 2.When I check the foruims for simiar problems, the formus are mostly for Visual basic 5.0, or other programs that I do not have.
Here is the programs I have installed:
Operating system: Windows XP
Microsoft .net framework 1.1
Microsoft .NET framwork 1.1 Hotfix(KB928366)
Microsoft .Net Framework 2.0 Service Pack 2
[code]....
All the security updates and hotfixes for Widows XP.
Get the current number of usage days, unique usage days, etc in an evaluation license using CryptoLicensing Generator.
View 1 RepliesI probably confused memory usage issues with the UI sharing same thread as the processing (as pointed out by MusiGenesis below). However regarding the Memory usage. I am still not able to find VB.net specific syntax, although people have pointed out some great .Net and C# information below (and if I were more versed in those technologies, one could adapt to make work with VB.net).The general concepts are working fine, however I am having issues where the Mem Usage on Task Manager keeps growing as the program is used to load more and more files.On Startup, before doing anything, the VB application has 27,000 K.Once the file is parsed and even after I dispose of the File handle as well as the the data increases a lot. I strip out everything in the code and it still seems that memory in Mem Usage remains captured. There is no rhyme or reason as to why the Mem Usage is growing (i.e. sometimes it can grow by 20 mb when reading a 7mb file, however other times it does not increase at all, when reading a 3mb file). Sometimes, it appers to release some memory when the parsing is complete and other times it just holds.I have looked at .Net Memory Profiler and have not really been able to make heads or tails from that.I have read a lot on internet regarding Memory Management on .Net in General about Dispose and "Nothing" and DataSets, etc, however have not really found anything regarding VB.Net specifically.My General Question is: Are there any good tutorials/books/blogs/etc that show a more in depth tutorial on managing memory in a VB.Net application (i.e. how/when to dispose/close, etc), or does anyone have some specific tips from there experience.
View 5 Replies