Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. My Application takes Very CPU usage and Memory

My Application takes Very CPU usage and Memory

Scheduled Pinned Locked Moved Visual Basic
comperformancehelp
13 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi All, My application takes a lot of Memory usage and CPU usage. I am using thread in timer and i am using 7 timer in a class.So please help me. Thanks Best Regard Anubhava Dimri

    mailto: anubhava.prodata@gmail.com

    A 1 Reply Last reply
    0
    • L Lost User

      Hi All, My application takes a lot of Memory usage and CPU usage. I am using thread in timer and i am using 7 timer in a class.So please help me. Thanks Best Regard Anubhava Dimri

      mailto: anubhava.prodata@gmail.com

      A Offline
      A Offline
      Ashutosh Phoujdar
      wrote on last edited by
      #2

      Please use profiling tools any of following tools : CLR Profiler[^] NDepends[^] By using above tools, you will come to know expensive part of code. Then you can try to optimize that code. :)

      dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

      L 2 Replies Last reply
      0
      • A Ashutosh Phoujdar

        Please use profiling tools any of following tools : CLR Profiler[^] NDepends[^] By using above tools, you will come to know expensive part of code. Then you can try to optimize that code. :)

        dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        But how can i know in which module is generating that problem.and I m using on error resume next for error resloving.

        mailto: anubhava.prodata@gmail.com

        A A D 3 Replies Last reply
        0
        • L Lost User

          But how can i know in which module is generating that problem.and I m using on error resume next for error resloving.

          mailto: anubhava.prodata@gmail.com

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          eg_Anubhava wrote:

          how can i know in which module is generating that pr

          Thats what the profiling tools show you.

          eg_Anubhava wrote:

          on error resume next for error resloving

          Nothing to do with profiling, but it could mean you are not freeing up resources if you get an error.

          Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

          1 Reply Last reply
          0
          • L Lost User

            But how can i know in which module is generating that problem.and I m using on error resume next for error resloving.

            mailto: anubhava.prodata@gmail.com

            A Offline
            A Offline
            Ashutosh Phoujdar
            wrote on last edited by
            #5

            :confused: Have you tried to use any of mentioned tool. Better to try out, You will granular report on which function or module is taking most of CPU time.

            dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

            L 1 Reply Last reply
            0
            • A Ashutosh Phoujdar

              :confused: Have you tried to use any of mentioned tool. Better to try out, You will granular report on which function or module is taking most of CPU time.

              dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Hi, When i m starting application throw CLRProfiler it generates an error. Error Detail is given below: ee the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at CLRProfiler.Form1.WaitForProcessToConnect(String tempDir, String text) at CLRProfiler.Form1.startApplicationButton_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CLRProfiler Assembly Version: 1.0.1395.16737 Win32 Version: 1.0.1395.16737 CodeBase: file:///E:/Other/Download%20Projects/CLR/Binaries/CLRProfiler.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win3

              D 1 Reply Last reply
              0
              • L Lost User

                But how can i know in which module is generating that problem.and I m using on error resume next for error resloving.

                mailto: anubhava.prodata@gmail.com

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                eg_Anubhava wrote:

                and I m using on error resume next for error resloving.

                That's not "error resolving", that's burying the errors. If you're using "On Error..." in VB.NET code, you're digging yourself a hole. That only exists for VB6 backwards compatiblity. I highly recommend re-writing the code to use Try/Catch blocks instead.

                eg_Anubhava wrote:

                mailto: anubhava.prodata@gmail.com

                And noone cares about your email address except spammers.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                L 1 Reply Last reply
                0
                • L Lost User

                  Hi, When i m starting application throw CLRProfiler it generates an error. Error Detail is given below: ee the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at CLRProfiler.Form1.WaitForProcessToConnect(String tempDir, String text) at CLRProfiler.Form1.startApplicationButton_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CLRProfiler Assembly Version: 1.0.1395.16737 Win32 Version: 1.0.1395.16737 CodeBase: file:///E:/Other/Download%20Projects/CLR/Binaries/CLRProfiler.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win3

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Comment out your error handlers. It appears that your code is generating errors in a loop, but your "error handling" code is burying the errors so you can't see them.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    eg_Anubhava wrote:

                    and I m using on error resume next for error resloving.

                    That's not "error resolving", that's burying the errors. If you're using "On Error..." in VB.NET code, you're digging yourself a hole. That only exists for VB6 backwards compatiblity. I highly recommend re-writing the code to use Try/Catch blocks instead.

                    eg_Anubhava wrote:

                    mailto: anubhava.prodata@gmail.com

                    And noone cares about your email address except spammers.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Hi Sir, My application normally takes CPU usage 0 - 5 in administrator account but in Guest account it takes 10- to 46. please suggest me what is the problem

                    mailto: anubhava.prodata@gmail.com

                    D 1 Reply Last reply
                    0
                    • A Ashutosh Phoujdar

                      Please use profiling tools any of following tools : CLR Profiler[^] NDepends[^] By using above tools, you will come to know expensive part of code. Then you can try to optimize that code. :)

                      dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      How can i know that in which process takes a lot of memory.

                      mailto: anubhava.prodata@gmail.com

                      A 1 Reply Last reply
                      0
                      • L Lost User

                        How can i know that in which process takes a lot of memory.

                        mailto: anubhava.prodata@gmail.com

                        A Offline
                        A Offline
                        Ashutosh Phoujdar
                        wrote on last edited by
                        #11

                        Please use This[^] it will provide you bits and pieces on your system's memory utilization.

                        dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                        L 1 Reply Last reply
                        0
                        • A Ashutosh Phoujdar

                          Please use This[^] it will provide you bits and pieces on your system's memory utilization.

                          dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          My application gets memory from 13000 to 30000 and CPU Usage is 0 to 1. I am developing application in vb.net.And i am using image in application. is Image or .Net framework or comment occoupies memory.

                          mailto: anubhava.prodata@gmail.com

                          1 Reply Last reply
                          0
                          • L Lost User

                            Hi Sir, My application normally takes CPU usage 0 - 5 in administrator account but in Guest account it takes 10- to 46. please suggest me what is the problem

                            mailto: anubhava.prodata@gmail.com

                            D Offline
                            D Offline
                            Dave Kreskowiak
                            wrote on last edited by
                            #13

                            You're using VB.NET and the old VB6 error handling?? Not a good idea... Anyway, it's impossible to tell you what the problem is because we haven't seen your code. Don't post the entire project. What you have to do is use a code profiler to find out where the problem is. Since the app works as an admin and bogs down as a normal user, I'd say you're doing something that requires admin rights, but your error handling is written so badly, it's burying all the errors.

                            A guide to posting questions on CodeProject[^]
                            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                 2006, 2007, 2008

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups