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:
Public Class Form1 Dim drag As Boolean Dim mousex, mousey As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.SetDesktopLocation(My.Computer.Screen.Bounds.Width * 0.869, My.Computer.Screen.Bounds.Height * 0.5) My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath) Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Label1.Text = My.Computer.Info.AvailablePhysicalMemory / (1024 * 1024) Dim FreeRAM As Double = Val(Label1.Text) FreeRAM = Math.Round(FreeRAM, 0) Label1.Text = FreeRAM & " MB" End Sub Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove If drag Then Me.Top = Windows.Forms.Cursor.Position.Y - mousey Me.Left = Windows.Forms.Cursor.Position.X - mousex End If End Sub Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown drag = True mousex = Windows.Forms.Cursor.Position.X - Me.Left mousey = Windows.Forms.Cursor.Position.Y - Me.Top End Sub Private Sub Form1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseClick drag = False If e.Button = MouseButtons.Right Then Form2.Show() End If End Sub Private Sub PictureBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick Me.Close() End Sub End Class




Reply With Quote