Memory Usage

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a 325k VB.Net app that when loaded uses about 25Meg. There's SQL
calls, etc. but how can it take up so much space and how can I reduce the
memory footprint? John
 
John said:
I have a 325k VB.Net app that when loaded uses about 25Meg. There's SQL
calls, etc. but how can it take up so much space and how can I reduce the
memory footprint? John

You have to remember that the 325k vb.net app uses the .net framework
classes, so your executable uses a subset of some 25 meg .net install.

Chris
 
Well i also thought that the memory footprint of a .Net application is way
to big

untill i discovered the following trick

Private Declare Auto Function SetProcessWorkingSetSize Lib "kernel32.dll"
(ByVal procHandle As IntPtr, ByVal min As Int32, ByVal max As Int32) As
Boolean
Friend Sub SetProcessWorkingSetSize()

Try

Dim Mem As Process = Process.GetCurrentProcess()

SetProcessWorkingSetSize(Mem.Handle, -1, -1)

Catch ex As Exception

End Try

End Sub

this will trim you applications memory usage ,,,, it is safe to use the
method call after the first start of your application and when your program
is beeing minimized
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top