Dave Kreskowiak wrote:Memory as measured by what?? Please don't tell me you used TaskManager! It's kind of lying to you when it comes to .NET apps. You really have to understand what TaskManager is looking at. If you want more accurate numbers of what your APPLICATION is using, use Performance Monitor and the .NET Memory counters.
I do use Task Manager and I added all the columns that refer to Memory. I compared that to the previous version of my application using Arrays. It may not be accurate completely but I would beg to differ if you think it's useless It tells me that the version with Datatables instead of an Array is taking 6 x as much memory.
I use the following to flush memory, which I have good luck with in the past.
Public Class MemoryManagement<br />
Private Declare Function SetProcessWorkingSetSize Lib "kernel32.dll" ( _<br />
ByVal process As IntPtr, _<br />
ByVal minimumWorkingSetSize As Integer, _<br />
ByVal maximumWorkingSetSize As Integer) As Integer<br />
Public Shared Sub FlushMemory()<br />
If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then<br />
SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)<br />
End If<br />
End Sub<br />
Dave Kreskowiak wrote:glumlord wrote:
Processor - While storing to the Datatable the processor is at 15-30%
30%?? Who cares??
It does matter because this app is on every single desktop pc in our organization and opens at windows startup when processor time will directly affect how quickly a user can use his/her pc.
Dave Kreskowiak wrote:The DataTable class has quite a large overhead compared to an Array. So, if an array works for you, great! If not, you may want to look into a Generic collection solution.
Thanks for that suggestion, I'll do some research into that. I appreciate any help I can get as most of this stuff I have learned from reading and am still quite wet under the ears.