Results 1 to 6 of 6

Thread: Resource Hog?

  1. #1
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19

    Resource Hog?

    I installed yesterday a small bundled app on one of the older computers on our LAN. One of its users complained this morning that its response was "glacial". I ran Task Manager and found that the app itself took 0 CPU time, but Thinbasic.exe took on average 70% of CPU time, with a peak of 83%! This machine is running WIN XP SP3 on a 2.4GHz Pentium with 512MB RAM and a 40G hard disk. The RAM is admittedly small, but is this normal?

    Rick

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    Hi Rick,

    bundled EXE are not real executables but are more like a ZIP file.
    When you run a bundled EXE, it extracts on disk a bundled version of thinBasic.exe, than thinBasic.exe is invoked in order to execute real script.
    So the running real application is thinBasic.exe and it is normal to see CPU allocated to thinBasic.exe and not to your bundled exe name.


    About CPU usage, it really depends on how you wrote your script.

    For example:
    If you create a loop inside which you do something contiguously without giving some free time to the processor ... it is quite normal you will follow into heavy CPU usage.
    The same if you do TBGL loops without using timers.
    The same if you have a UI and you use loops without using timers.

    So, it is hard to understand from outside why your CPU is so high without having some example to check and explain the logic of the application.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19

    Resource Hog

    That's exactly what it is doing, Eros. I will put in a SLEEP to pace it. Thanks.

    Rick

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    If there is an indicative piece of code that you can post showing the loop creating the CPU usage I can try to check
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Senior Member zak's Avatar
    Join Date
    Dec 2008
    Posts
    637
    Rep Power
    83
    i have faced this before in this thread... , and using DOEVENTS inside the loop relief the possible freezing the program

  6. #6
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19

    Resource Hog

    Here is the piece of code, as modified with a 100msec sleep. CPU usage now unmeasurable.

    Do 
      NBytes = COMM_Get ( hcomm, %COMM_RXQUE ) 
      If NBytes => 21 Then
        COMM_Recv ( hcomm, NBytes, InBuff )
        Exit Do
      EndIf
      If Len ( Console_InKeyB ) > 0 Then
        Console_Cls
        Console_PrintAt ( "ABORTED BY USER", 32, 12 )
        Console_WaitKey ( 3 )
        COMM_Close ( hcomm )
        Stop
      EndIf
      Sleep (100)
    Loop
    

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •