Measuring Memory Consumption Of Function That Accesses Database
Aug 25, 2009
I have a VB Function (in Visual Studio 2008 with .NET 3.5) that opens up a connection to an Oracle database and queries the database for information. Apparently after some trial and error, I discovered when the SQL statement is being processed and filling the dataset, it apparently is taking up too much memory trying to complete the task.I'm running into System.OutofMemory exceptions and other unpleasantness.I'm wondering, is there some sort of program out there to measure memory consumption of your SQL code that is being processed in a Visual Studio application?
View 2 Replies
ADVERTISEMENT
Sep 16, 2011
I have a VB Function (in Visual Studio 2008 with .NET 3.5) that opens up a connection to an Oracle database and queries the database for information. Apparently after some trial and error, I discovered when the SQL statement is being processed and filling the dataset, it apparently is taking up too much memory trying to complete the task. I'm running into System.OutofMemory exceptions and other unpleasantness.I'm wondering, is there some sort of program out there to measure memory consumption of your SQL code that is being processed in a Visual Studio application?
View 1 Replies
Apr 19, 2011
I've been profiling a WinForm's application using ".NET Memory Profiler".I can't quite seem to understand how my application is growing to 1GB, then 2GB, then 3GB of usage - according to windows task manager.
The private bytes using that tool, and "Total Bytes in All Heaps" shows only as 70MB or so. At the top of my list of instances hanging around, they are mostly String, or WeakReferences to lots of little objects.
All the application is doing is showing a form that loads data from a database. I repeat the show/dispose cycle of the form about 100 times and the growth is continuous.I've tried about 3 memory profiling tools now and none of them are showing me where this enormous amount of memory consumption is coming from.
View 3 Replies
Apr 5, 2011
I found what seems to be an easy and effective way to reduce the memory consumption of my vb.net app. What I need to know is how "correct" or "proper" is the method I'm using for my application and what exactly is going on behind the scenes that I should worry about? I want to release memory every time a form closes. Here is how I reduce the required memory of my program:[code...]
View 7 Replies
Aug 15, 2011
According to the language specification guide for VB.NET Section 10.9.3. The enumerator expression in a for each loop is copied over into memory. If I have a list of 10000 objects that list will be in memory twice for the code below?
dim myList as new list(of bobs)
'put 10000 bobs in my list
for each x In myList
'do something
next
If I were generating the list from a linqQuery or some other such query it would make sense to generate that list at the for each loop statement thus not having the list in memory twice for example.
for each x in myList.where(function(x) x.name = Y)
'do something
next
If the LINQ query is unreadable on the for each loop, do I forgo readability and just put it on the for each loop declaration line? Should I declare the list in its own variable and just bite the bullet and have the list exist twice in memory?
View 1 Replies
Mar 11, 2010
I did a project (College Management) in vb.net 2008 which contains 13 forms in it. I designed the different functions in a different normal form, i.e. frmAdmission, frmSearch etc. When the project run's the main form is loaded. When user chooses a particular function say 'frmSearch' then the main form is unloaded and the form frmSearch is loaded. Now my lecturer told me to use MDI forms instead of normal forms because, normal forms takes larger memory than the MDI forms.
View 5 Replies
Jun 23, 2009
I am redesigning an application that I have previously written which accesses an SQL database, pulls records, creates an object hierarchy based on a bunch of custom classes that I created, and displays them in a TreeView control. When the user selects a node, a tabbed page displays the information about the object underlying the TreeNode selected.
I have since begun experimenting with Databinding to my Objects as I have recently redigned the objects to communicate directly with the datarow that each object is based on instead of storing the values in a private variable thus:
[Code]...
Allowing the databinding management objects to do the heavy lifting of getting the values, displaying them in the controls and writing new values as needed back to the objects (and thus the DataSet) i think is preferable. How can I accomplish this? I have added the Objects as datasources to the DataSources window, added the objects elements to the tabbed pages. How do I bind those controls to the item that is specified by selecting the TreeNode?
View 7 Replies
Mar 9, 2010
i have a program that accesses an access database but i have a problem with this line
-'dbSkillCommand.Fill(dsSkillPageData, "skill")'giving this error message
-'No value given for one or more required parameters.' [code]
View 1 Replies
Jan 7, 2009
I am about to commence coding (actually recoding) on a project that accesses 100 tables of a database, more to added at later time. About half of the accesses are queries with joins and unions. I am more of a coder to not use wizards such tableAdapter, but code more by other methods. I have read some post of this site that suggest avoiding tableAdapters, not to use them in an Enterprise environmentl, but no reasons. I would like to hear from willing to bend my ear, pro or con.
View 1 Replies
Aug 2, 2010
I need to display a table in rich text within a form window. It is only a two column table, so tabbing works fine to line everything up (since RichTextBox does not support RTF tables). However, sometimes the tab stops are incorrect because of non-fixed width fonts.
So, I need a way to measure the pixel width of a particular string with a particular font (Arial 10) and space or tab pad to make sure that everything aligns.
I know about the Graphics.MeaureString method, but since this is in a rich text box, I don't have an initilzed PaintEventArgs variable, and that would seem like overkill to create JUST to measure one string.
From MSDN:
Private Sub MeasureStringMin(ByVal e As PaintEventArgs)
' Set up string.
Dim measureString As String = "Measure String"
[Code].....
So is the best bet just to create a dummy PaintEventArgs instance? If so, what is the best way to do that (since I'll have to call this string measuring method several hundred times)?
View 1 Replies
Nov 30, 2010
I am going to write a standalone code in VB.net that can measure the angle between two faces in a CAD model opened in solidworks. But i am not allowed to use solidworks API or SDK add-in.
View 5 Replies
Jun 23, 2011
How to measure the number of bytes sent and received while using the internet from VB.NET 2010 ?
View 1 Replies
Feb 7, 2010
How would I get it so every time a timer ticks it measures the ammount of sound coming out of the application and puts it into a progress bar? it's any help I'm using an "axprogressbar" set to go vertical.
View 6 Replies
Aug 7, 2009
Assume I have a large dataset and I want to run a "like" function in the dataset eg column - NameIs there any way to run a like statement in a dataset.
View 5 Replies
Nov 20, 2009
Assume I have a large dataset and I want to run a "like" function in the dataset eg column - Name..Is there any way to run a like statement in a dataset.Is it possible with ASP.NET? I dont want to run a query to the database.
View 3 Replies
Dec 7, 2010
I wanted to know if u define a dimension in a function or subroutine and that func/sub is called say 5 times, does the memory new block of memory get assigned to it every time the func/sub is run or does it use the one it got assigned the first time?
View 6 Replies
Apr 18, 2012
I don't use VB.Net very much, still mostly do VB6, but I am doing this project in .Net. I have a huge string of data, 168 Mb that I stream in from a file to a string variable. Then I have to perform a number of replacements on it before using the data to compile statistics. Because of the nature of the data, I can't break this up into smaller strings.
The problem is that I get a system out of memory error after a few replacements.
I've used both Replace(x,y,z) and X.Replace(y,z). The second one gets a little farther in the code before it crashes, but they both crash.
When I run it in the IDE, the IDE is using about 130 Mb of RAM, the Exe of the app is running about 350 Mb, and one svchost.exe runs about 300 Mb
Other than that there are no major RAM uses going on. The PC has an i7 980x cpu with 12 GB of RAM.
View 2 Replies
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
Aug 4, 2010
Read (search a value) in a non specific process memory. Write a value in the address found in the last function requested.
View 2 Replies
Sep 18, 2009
I am looking to record information about the computers power consumption over time, is there any way I could do this using vb, I can get the current voltage from the processor but do not know the current therefore can not work out the wattage. I know of application which do have power consumption recorders but I would like to create my own.
View 1 Replies
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
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
Sep 17, 2011
I have a function which return the Dataset and my question is that, is dataset memory release automatic when function work finished if not please suggest me how i release memory in below sample question?
public function givemedataset()
dim keepme as new dataset
'grabbing record into dataset
return keepme
end function
Private Sub forumbrowsebtn_Click
dim getme as dataset=givemedataset
end sub
View 1 Replies
Jan 18, 2010
Target machine 4 core AMD I have an event that is raised my the main thread of the application. The event is consumed by several different classes in the application. I want them all to run concurrently up to the max cores available and then que the rest in order.The work routine in each class is relatively small but concurrency is the goal.Considering this.
A. Create a background worker on each classes initialization and have the event handler start the worker.
B. Create a delegate to the do-work sub that is called by the event handler
A- Pros - worker is only created once and reusable so only pay creation cost once.
A-Cons could create a ton of workers that consume resources eventually.
B- Pros Smaller thread pool
B- Cons Lot of overhead
View 2 Replies
Aug 6, 2010
I have a VB.NET solution, just upgraded from 3.5 to 4.0. One of the classes has a private field:
Private _Projection As ICalculatedPath.At runtime, any time the class containing that field accesses that field, I get a FieldAccessException. The first time that field happens to get accessed is a null check in a method, and one of the things I randomly tried is changing the above line to:
Private _Projection As ICalculatedPath = Nothing.When I do this, I get the FieldAccessException on that line saying that the class's .ctor() cannot access that field. I've also tried making the field protected and public, clean/rebuild solution, restarting VS, targeting x86 and .NET 4.0 specifically on every project in the solution, and other non-sensical measures to get rid of this Exception but to no avail. This code worked fine before the upgrade, of course.
View 2 Replies
Dec 9, 2010
There are problems installing an application developed in VB6 that accesses SQL Server on Windows 7?
View 1 Replies
Mar 18, 2010
I have written a multithreaded crawler and the process is simply creating threads and having them access a list of urls to crawl. They then access the urls and parse the html content. All this seems to work fine. Now when I need to write to tables in a database is when I experience issues. I have 2 declared arraylists that will contain the content each thread parse. The first arraylist is simply the rss feed links and the other arraylist contains the different posts. I then use a for each loop to iterate one while sequentially incrementing the other and writing to the database. My problem is that each time a new thread accesses one of the lists the content is changed and this affects the iteration. I tried using nested loops but it did not work before and this works fine using a single thread.
Here is my
SyncLock dlock
For Each rsslink As String In finallinks
postlink = finalposts.Item(i)
[CODE]...
Finallinks and finalposts are the two arraylists. I did not include the rest of the code which shows the threads working but this is the essential part where my error occurs which is basically here postlink = finalposts.Item(i) i = i + 1
ERROR: index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index
I tried copying it to a new list but dosent work.
View 9 Replies
Aug 29, 2011
i am doing a small project for my business and i got stuck with this 2 weeks ago and still no progress.I have an access db table "store" that has columns: (filldate,brand,model,plateno,mileage,litres) where i am storing these info each time a car in my company fills gas. For example8/25/2011,Renault,Megane,5487844,3943,20).What i want to do now is to display in a datagrid the total consumption of gas (litres) with the kilometers driven (mileage) between 2 dates.
View 2 Replies
Oct 24, 2011
i wrote a .NET function :
Public Function ExecuteSql(strSql As String, connectionString As String) As SqlDataReader
Dim conn As New SqlConnection(connectionString)
Dim cmd As New SqlCommand(strSql, conn)
Dim dr As SqlDataReader
[code]....
As you can see,this function return a datareader, so i can manipulate data as i like. The problem is: the connection remain open.Is there a command to 'close globally connection' ?
View 2 Replies
Oct 31, 2010
My routine to check for updates is run as a separate process. Exiting the application is required to update, so a dialog asks the user, when an update is found, if they want to exit now. f they do, the code (from the update thread) calls Application.Exit().However, if the FormClosed event of any form that needs to be closed needs to access its controls, an invalid cross-thread operation is detected (which sounds pretty logical).
View 1 Replies