Memory Management - Reducing The Commit Size Of Application
Oct 15, 2009
I have an application which I've developed which queries Active Directory information and stores about 15 properties into a Datatable which is kept in memory. I need to decrease the amount of "Commit" memory it is setting aside. The application stays active in the system tray and allows for quick searching of information along with pictures for users. I have a class, which is able keep memory usage down pretty low. It runs on a timer every 10 seconds and listed below:
[Code]...
View 1 Replies
ADVERTISEMENT
Aug 30, 2009
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 Replies
Apr 18, 2012
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)?
View 3 Replies
Jan 27, 2010
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 Replies
Jan 21, 2012
I've looked up ways to reduce the ViewState:
Viewstate Optimisations
Strategies for reducing ViewState size in asp.net
However, due to the situation I'm in, I need the quickest and most effective ways to reduce the ViewState size. The legacy system I'm working on is bloated and routinely has a ViewState that's 800Kb+ on multiple postbacks.
For example, I'm pretty sure populating drop down lists with 100+ items on multiple post backs is one of the culprits, correct?
Disabling the ViewStae entirely doesn't appear feasible. It breaks all of the controls, of which there are many, rendering the pages unusable. If this is the best approach, how should I go about handling all the broken controls?
View 4 Replies
Jun 28, 2011
I noticed that when using a single letter as the title on a tab of a Tab Control , the tab is bigger that it should . Look on this example :
The above Tab Control behaves normally because the text on each tab is sufficient to keep it big enough . The lower Tab Control , however , has its tabs too big . Is it possible to reduce its width ? I saw there is an ItemSize property of the Tab Controls , but unfortunately I can only modify the height of the tabs . No matter what value I set for its width , the width remains always the same (and larger than it should) ...
View 4 Replies
Mar 19, 2012
Is there an easy way to edit the code below so that it copes (works the same) if the embedded resource is not a plain text file, but a compressed text file?
Dim tempList() As String
tempList = My.Resources.ENABLE.Split({Environment.NewLine}, StringSplitOptions.None)
For Each strWord In tempList
enableFullList.Add(New Words(strWord))
Next
I have seen System.IO.Compression but can't work out what to do, DeflateStream, GZipStream etc.
View 6 Replies
Nov 29, 2010
Im trying to enlarge a circle on a form using a scrollbar.I have managed to do this using the following [code]Thing is the code draws a circle on every scroll movement. You end up with a mass of circles. I want it to clear previous graphic and just show the circle that relates to the current scrollbar graphic, giving the impression of enlarging and shrinking.
View 3 Replies
May 10, 2011
Coming from more low-level languages like C++, and seeing how transparent .NET memory management is, I've got a concert about a piece a line of code I've written. In C++, every object necessarily (dictated design practices and peculiarities of memory management) needs to have a constructor and a destructor. In .NET, destructors aren't needed as often, and there are different patterns of when they are required and how to use them. My question is this. If I have the following like of code (in VB.NET, but equally applies to C#)
[Code]...
View 4 Replies
Nov 8, 2011
a) Dim strName as string
For i=0 to 100
strName=GetName()
do something with strname
Next
b) For i=0 to 100
Dim strName as string=GetName()
do something with strname
Next
Out of a and b which will be faster and consume less memory
Public sub GetResourceAttributes()
Dim colreSource as object
.using the colresource
colresource=nothing
end sub
Is sentencing'colresource =nothing'is good programming technique or is it enough to leave nothing done on 'colresource'. Like GC will take care of 'colresource' when there is no reference to the object.
View 2 Replies
Sep 28, 2010
I have an application that requires the use of many threads. How do i monitor the memory consumption of my application?And how can i monitor the CPU usage of my application if possible?And is it possible to monitor the memory consumtion and CPU usage of each of these threads?And is it possible to limit or prioritize the memory consuption or cpu usage of the whole application or of each thread?
View 5 Replies
Apr 23, 2009
I have 200,000 rows data need to be inserted into MSSQL 2005 express. I have 4G memory. From the beginning, there is 2.0G used. Then, I use microsoft text driver to load text file into datagridview. Memory rise to about 2.8 GB.I start write data row by row from datagrid view. Memory usage keep rising , then OutOfMemory exception is catched.I try to use GC.Collect and for System.Data.Odbc.OdbcConnection , I also try .Dispose(). But it is no use.How can I keeing the memory within about 3.0GB for this usage ? I monitor .vhost.exe. It rise to more than 1G.
View 2 Replies
Nov 16, 2010
I'm binding user settings to a bunch of controls on a WinForm dialog that has OK/Cancel buttons. While this works great to read in the bindings in, I would only like to commit binding changes if a user clicks OK, and not if they click cancel. Is there a simplistic setting to achieve this rather than managing all reading and committing myself?
Right now, let's say I have a textbox that binds to a user setting called "country". It has "United States" in it and if a user changes it to "Bolivia", that will get committed as soon as it is typed instead of when the OK button is pressed.
View 1 Replies
Jan 15, 2012
I'm binding user settings to a bunch of controls on a WinForm dialog that has OK/Cancel buttons. While this works great to read in the bindings in, I would only like to commit binding changes if a user clicks OK, and not if they click cancel. Is there a simplistic setting to achieve this rather than managing all reading and committing myself?
View 1 Replies
Jul 9, 2009
I've been trying to develop a VB application which retrieves a lot of information from an XML file on our secure intranet. So far I've been using...
Dim request As WebRequest = WebRequest.Create(xmlUrl)
request.Credentials = New NetworkCredential(username, password)
Dim response As WebResponse = request.GetResponse()
Dim str As Stream = response.GetResponseStream()
Where username and password are predefined. What I need is a way of utilising the Windows credential manager to handle this. Ideally, I like it to pop up a credential prompt at application start, and then store the credentials for later use. So far so easy, but I want to be able to use the tick box to save the credentials back to the store, so taht next time the application is used, they are already filled in.
So far I've been investigating the CredentialsDemo from MSDN, but have been unable to adapt the routines to a web request from the given example of a SQL request. In fact I've not even been able to get the demo working adapting it to my own SQL server!It utilises the CredUIPromptForCredentials function. Is this the right way to go? Or am I barking up the wrong tree?
View 8 Replies
Jun 8, 2012
I am currently using following code to estimate the size of the textbox:
Dim i As Integer, j As Integer, pGr As Graphics, sz As SizeF
For i = 1 To pNumRows
For j = 1 To pWidth
sb.Append("W")
Next
[Code]...
I was wondering if there is any way to remove the for-loops and do away entirely with the pGr (textbox.CreateGraphics) method and still correctly estimate the size of the textbox.If you're wondering why I am (actually the person who wrote the code) is looping through all the 'W', it's because (I think) 'W' has the biggest width and height in the entire character set, so the person (who wrote the code) is trying to guess the maximum area needed.
View 1 Replies
Jun 1, 2009
I am trying to construct a data management application for work. I had this working fairly well then moved over to VS 2008. When I am submitting my data via the button it is giving me a null exception error on the call sub.. Here is the code.[code....]
View 10 Replies
May 24, 2010
Please how can i publish an application created in vb.net along with a database which i created in SQL Management Studio?
View 4 Replies
Jul 23, 2009
I have built a MVC website on IIS6. I used the built-in ASP.NET Security without Membership, just the way it was implemented in the template solution. It is easy to secure a contoller or action, but now I need to expose the user management to an admin logged into the site. I understand that the builtin ASP controls for doing this are not "best practice" and are a dog to get working. So what is the best practice for offering user management through a ASP.NET MVC application?
I considered using the Entity Framework and wireing it up to the myriad of stored procs. but that seems awkward. I see options for AccountMembershipService and FormsAuthenticationService. That is what the existing project account controller uses. But, I am not fimilliar with either.I can't help but think that this should have already been there from the project template. This is a fundamental part of any website and you were given 15%, why not the rest?
View 5 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
Mar 9, 2009
I've developed an application in VB2008 express and have installed it to another PC. The installation has put the mdf file in c:documents and settingsuserappsdata.I want to attach this with SQL Server Management studio but when I try to browse to the file in order to attach it, I find I can't browse further then C:documents and settingsuser.
View 3 Replies
Jan 26, 2011
I am trying to manipulate files as part of a Document Management application that stores documents in a location on a Network Drives. But the My.Computer.FileSystem.Drives collection does not contain the Network Drives mapped on my machine. I have about half-a-dozen of these, but none of them seem to show up in the Drives collection and thus are not visible to the other FileSystem functionality I need to use for file management.
how to make sure the Drives collection contains all my drives? I am running VS2010 Premium edition on Windows 7 64-bit on a 64-bit Dell machine.
View 6 Replies
Aug 5, 2010
I want to do a small application that made the broadcast of images from a PC. The idea is to make an application of remote management but without the management part, only with the viewing of images. Anyone know any code already done or any API that helps in the project?
View 8 Replies
Jun 22, 2012
How do I find the memory or CPU used by my software?
View 8 Replies
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
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
Jan 26, 2012
A couple of months ago, before I started learning C++, I made an application in VB.net that reads memory from an external program. This could be anything, from notepad to windows media player etc. I have been trying to find a way to do the exact same thing in C++, but to my suprise I can't find anything straightforward on the subject. All google comes up with is threads on several forums, where the general response is "Windows doesn't allow you to read from memory you do not own". But if it works in VB.net, it can work in C++ too.
[Code]...
View 1 Replies
Oct 9, 2009
I'm using VB.Net, and I have a set of data which I have to able to filter through fairly quickly.Basically, the program is like google sugest, but instead of a drop-down menu, I'm using a listbox. When a user enters a word, I compare the word using LINQ and filter those that contain the user's input. The data are all strings of variable length (from 0 to 200 characters, most on 150 character mark), and I have 240,000+ of this strings and counting- all stored in an XML file.
A colleague of mine told me that loading all of that to memory (using VB.Net's XML serializer plus collections of string/objects) is not practical, and would slow the 'startup' time of the program. I haven't finished building the program yet and I'm having second thoughts about continuing this path.
So, my question is: Should I continue with my current approach on the problem (which is load everything to memory on startup), or is there a better way of solving my dilemma?
View 6 Replies
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
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