Hi CPU Usage even at rest
#3
(01-16-2023, 12:58 PM)SMcNeill Wrote: I tried to reproduce this type of behavior with a version of Linux Mint, run via a VMware virtual machine, but I couldn't get it to idle with any real CPU usage.  Is there something specific in the code you're running, which might contribute to the difference?  Does it have several $INCLUDE files?  Rely on several DECLARE LIBRARY calls?  Is it a long set of code, such as the qb64pe.bas file itself?

Usually such issues are nothing more than an endless loop without any sort of limit or delay in them.  They run over and over and over, without pausing to let the CPU share resources with other processes like it should.  The only issue is figuring out *where* in the vast sea of code that is qb64pe, one of these endless loops might be hiding.  Any further details, or test code, which you can share, will help us try to pinpoint exactly what to be digging into for the issue.  Smile

I am using Mint 21.1 with Cinnamon on a Proxmox Server. 

The VM has 4GB Ram, 64GB SDD, 4 Cores 

Just starting QB64PE takes the CPU up to 70% before loading the .bas file 

The code is below. 

I will try another VM and report back. 

Thx!


Code: (Select All)
Input "Day  : "; d$
Input "Month: "; m$
Input "Year : "; y$
d = Val(d$)
m = Val(m$)
y = Val(y$)
m = (m + 9) Mod 12
y = y - m / 10

weekday = Zeller(d, m, y)

Restore DataDayKey
For X = 1 To 7
    Read dKey$(X)
Next X
Print "Week Day = ", dKey$(weekday)

End



DataDayKey:
Data "Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"



Function Zeller (d, m, y)
    Dim t1, t2, t3, t4
    If month < 3 Then
        y = y - 1
        m = m + 12
    End If
    t1 = Int(((m + 1) * 26) / 10)
    t2 = Int(y / 4)
    t3 = Int(y / 100)
    t4 = Int(y / 400)
    Zeller = (d + t1 + y + t2 + 6 * t3 + t4) Mod 7
End Function
Reply


Messages In This Thread
Hi CPU Usage even at rest - by daivdW2 - 01-16-2023, 12:05 PM
RE: Hi CPU Usage even at rest - by SMcNeill - 01-16-2023, 12:58 PM
RE: Hi CPU Usage even at rest - by daivdW2 - 01-16-2023, 01:34 PM
RE: Hi CPU Usage even at rest - by mnrvovrfc - 01-16-2023, 03:12 PM
RE: Hi CPU Usage even at rest - by daivdW2 - 01-17-2023, 07:47 AM
RE: Hi CPU Usage even at rest - by SMcNeill - 01-17-2023, 08:30 AM
RE: Hi CPU Usage even at rest - by daivdW2 - 01-17-2023, 12:20 PM
RE: Hi CPU Usage even at rest - by mnrvovrfc - 01-17-2023, 05:43 PM
RE: Hi CPU Usage even at rest - by daivdW2 - 01-19-2023, 09:45 PM
RE: Hi CPU Usage even at rest - by Fifi - 01-21-2023, 01:34 PM
RE: Hi CPU Usage even at rest - by daivdW2 - 01-25-2023, 08:41 AM
RE: Hi CPU Usage even at rest - by mnrvovrfc - 01-25-2023, 04:46 PM



Users browsing this thread: 5 Guest(s)