Click here to Skip to main content
15,912,072 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 7:59
glumlord12-May-09 7:59 
AnswerRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 8:32
Ian McCaul12-May-09 8:32 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 8:37
glumlord12-May-09 8:37 
GeneralRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 8:43
Ian McCaul12-May-09 8:43 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 9:26
glumlord12-May-09 9:26 
GeneralRe: Seeking advice for storing data in memory Pin
jarbo3a12-May-09 20:13
jarbo3a12-May-09 20:13 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 7:35
glumlord13-May-09 7:35 
AnswerRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 8:43
mveDave Kreskowiak12-May-09 8:43 
Well, you have 400 records, not 7200, unless your database is laid out funky... You have 7200 total fields of data.

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.


glumlord wrote:
Processor - While storing to the Datatable the processor is at 15-30%


30%?? Who cares??


glumlord wrote:
Memory - Even after flushing the memory using a class I have my application is taking 6MB now instead of roughly 800k-1024k it was before.


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.

Task Manager is showing you what is RESERVED for your process, not necessarily "in use". .NET CLR applications run inside a "virtual machine", not unlike what Java uses. What you're seeing is the memory that is sitting in the Managed Memory Pool for your application inside the "virtual machine". The .NET CLR maintains a pool of memory to speed allocations of future objects. It tunes itself to try and predict how your app is going to use memory in the future, based on what it's done in the past. It gets this memory from Windows and adds it to the Managed Pool. If Windows starts running low on memory, it can ask the .NET CLR to free up however much memory it needs and the CLR will be more than happy to return whatever it can spare.

Basically, unless you have a condition where your app runs the machine out of memory, or is using excessive amounts of memory, you're worrying about nothing. The .NET CLR does a very good job of managing memory and playing nice with the rest of the system.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 9:24
glumlord12-May-09 9:24 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 11:01
mveDave Kreskowiak12-May-09 11:01 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 9:45
sitebuilderLuc Pattyn12-May-09 9:45 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 10:57
mveDave Kreskowiak12-May-09 10:57 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 13:54
sitebuilderLuc Pattyn12-May-09 13:54 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 16:12
mveDave Kreskowiak12-May-09 16:12 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 7:30
glumlord13-May-09 7:30 
QuestionUnable to run the code from sp1 in sp2 Pin
SuchiTN12-May-09 4:06
SuchiTN12-May-09 4:06 
AnswerRe: Unable to run the code from sp1 in sp2 Pin
Pete O'Hanlon12-May-09 4:20
mvePete O'Hanlon12-May-09 4:20 
AnswerRe: Unable to run the code from sp1 in sp2 Pin
Luc Pattyn12-May-09 4:39
sitebuilderLuc Pattyn12-May-09 4:39 
Question[Message Deleted] Pin
lynn100712-May-09 3:34
lynn100712-May-09 3:34 
AnswerRe: How to use activeX function that has a pointer parameter in JavaScript? Pin
Dave Kreskowiak12-May-09 6:56
mveDave Kreskowiak12-May-09 6:56 
Question[Message Deleted] Pin
dragonfighterlee2112-May-09 2:36
dragonfighterlee2112-May-09 2:36 
AnswerRe: ADD FILES TO SINGLE EXECUTABLE IN VB.NET Pin
Dave Kreskowiak12-May-09 6:55
mveDave Kreskowiak12-May-09 6:55 
GeneralRe: ADD FILES TO SINGLE EXECUTABLE IN VB.NET [modified] Pin
dragonfighterlee2112-May-09 7:29
dragonfighterlee2112-May-09 7:29 
GeneralRe: ADD FILES TO SINGLE EXECUTABLE IN VB.NET Pin
Dave Kreskowiak12-May-09 8:26
mveDave Kreskowiak12-May-09 8:26 
QuestionMDI child window maximize through title-bar double-click Pin
angusmax12-May-09 0:03
angusmax12-May-09 0:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.