Was just wondering, why would a 70KB application takes almost 10MB of RAM? All the application does is that it shows the amount fo FREE RAM my computer has. It has 2 pictures, an icon and 2 labels. The amount remains the same, it doesn't increase with the passing of time, I just think such a small application shouldn't eat that much memory.

All code is below:

vb.net Code:
  1. Public Class Form1
  2.  
  3.     Dim drag As Boolean
  4.     Dim mousex, mousey As Integer
  5.  
  6.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  7.  
  8.         Me.SetDesktopLocation(My.Computer.Screen.Bounds.Width * 0.869, My.Computer.Screen.Bounds.Height * 0.5)
  9.  
  10.         My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
  11.  
  12.         Timer1.Start()
  13.  
  14.     End Sub
  15.  
  16.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  17.  
  18.         Label1.Text = My.Computer.Info.AvailablePhysicalMemory / (1024 * 1024)
  19.  
  20.         Dim FreeRAM As Double = Val(Label1.Text)
  21.         FreeRAM = Math.Round(FreeRAM, 0)
  22.         Label1.Text = FreeRAM & " MB"
  23.  
  24.     End Sub
  25.  
  26.     Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
  27.  
  28.         If drag Then
  29.  
  30.             Me.Top = Windows.Forms.Cursor.Position.Y - mousey
  31.  
  32.             Me.Left = Windows.Forms.Cursor.Position.X - mousex
  33.  
  34.         End If
  35.     End Sub
  36.  
  37.     Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
  38.  
  39.         drag = True
  40.  
  41.         mousex = Windows.Forms.Cursor.Position.X - Me.Left
  42.  
  43.         mousey = Windows.Forms.Cursor.Position.Y - Me.Top
  44.  
  45.     End Sub
  46.  
  47.     Private Sub Form1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseClick
  48.      
  49.    drag = False
  50.      
  51.    If e.Button = MouseButtons.Right Then
  52.          
  53.   Form2.Show()
  54.      
  55.   End If
  56.  
  57.     End Sub
  58.  
  59.     Private Sub PictureBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick
  60.      
  61.    Me.Close()
  62.  
  63.     End Sub
  64.  
  65. End Class