xk_k130
Posts: 4
Joined: Tue Jul 09, 2019 7:34 am

RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 11:23 am

Hi all, I'm running Raspbian on a Pi4 4GB with all updates and upgrades current. I was running the Pi Shim, but changed it for an Ice Tower cooling system. I run the official mouse, keyboard and PSU - all beautifuly wrapped in a pimoroni PI Coupe case.

All was going well until recently, when the Pi started to spike the CPU whilst using Chromium. The frequency of the spiking increased day by day until it started 'freezing' for up to 5 seconds at a time. I've spent money on buying an official Sandisk micro SD card and completely reinstalling Raspbian, but it's just the same. In the last few days I bought a Kingston 64GB class 10 micro SD card and there's no difference - the spiking and 'freezing' still continue. I've enabled/disabled the open GL and the fake video driver, both, but nothing changes.

For the record, I performed the overclocking steps on the Tom's Hardware site but reduced the amount to a more modest 1750GhZ after it started initially locking up.

I'm running out of ideas now - anyone else getting freezing or CPU spiking?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25466
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 1:23 pm

Turn off all overclocking just to check it's not that.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jahboater
Posts: 5221
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 1:45 pm

xk_k130 wrote:
Tue Dec 24, 2019 11:23 am
I'm running out of ideas now - anyone else getting freezing or CPU spiking?
No, my Pi4 4GB does not freeze up.

"CPU spiking" if it means what I think you mean, is normal (all CPU's run at 100% utilization when executing code) but there are three other spare CPU's for other tasks (and the scheduler will reduce the priority of CPU bound programs).

As JamesH says, see how you get on with the stock settings.

Monitor the memory with "free -h" or "vmstat" to check its not swapping (which will appear to "freeze" the machine).
Web browsers are notorious for using ridiculous amounts of memory but you do have 4GB which should be plenty.

I use a tiny overclock (1.6GHz) and its always very responsive.

xk_k130
Posts: 4
Joined: Tue Jul 09, 2019 7:34 am

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 4:02 pm

Thankyou for the replies, I turned off the overclocking and the symptoms are the same. I meant to say in my original post that my Pi ran great and without error until I started getting messages about needing to reorganise my file system or something (I forget the actual message) until one day it just wouldn't boot at all. I re-flashed Raspbian onto the same 32GB card but it only lasted a couple of weeks until those messages started appearing again. During this time, the Pi didn't once appear to be freezing or unresponsive in any way, despite being overclocked to 2147GhZ.
Then I bought a new SD card and the trouble started from then on. Now that I've spent cash on an actual name-brand SD card (instead of the cheap generic ones I'd been using) I'm getting all these unresponsive episodes. I was wondering if I'd somehow managed to miss something obvious during reinstallation, like memory split allocation (currently 256 for GPU).

Incidentally, when I include the GPU_Freq line in the /boot/config.txt file, the pi won't boot, no matter the value, whereas it was no problem before, even at 750. So I have to make sure I don't include any line about GPU frequency at all when overclocking. I'm thinking that even though I overclocked the chip, the GPU is still stock. Could that be relevant?

Thanks.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25466
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 6:39 pm

I suspect that your SD card is full up. Go to /var/log and delete any overly large log files.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

xk_k130
Posts: 4
Joined: Tue Jul 09, 2019 7:34 am

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Tue Dec 24, 2019 10:35 pm

It's a 3 day old 64GB card, surely it cant be full yet.

renice123
Posts: 165
Joined: Tue Oct 15, 2019 3:56 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 3:08 am

Raspberries of the fourth version are more sensitive to memory cards than raspberries of the third version. If after you changed the memory card, crashes began to occur, then it makes sense to put another memory card. Or go back to the old memory card, which before that worked fine for you. It seems to me.
Chromium is also a headache for all memory cards - this browser is written to kill memory cards. Chromium writes a huge number of small files to disk always and everywhere, even if it is not required. This drastically reduces the resource of memory cards, and also often leads to freezing. I think if you are interested in establishing the cause of the freeze, you should at least check how well Raspberry works without Chromium. Just see how other programs work - GIMP or LibreOffice and others.
Refuse for a while from Chromium (which itself is the source of operating system errors) and run other programs. If everything goes well for you, in this case there will be no freezing and computer freezes, then Chromium is to blame. Otherwise, as I think, computer replacement is required.

hippy
Posts: 6862
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 1:52 pm

renice123 wrote:
Wed Dec 25, 2019 3:08 am
Raspberries of the fourth version are more sensitive to memory cards than raspberries of the third version.
Can you explain more, in what way, as I wasn't aware of that.

renice123
Posts: 165
Joined: Tue Oct 15, 2019 3:56 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 3:16 pm

As far as I know (based on messages on the forum), there were some strange problems with 32 GB memory cards. I can’t say whether they are resolved, because so far the branch remains open.
https://www.raspberrypi.org/forums/view ... 8&t=248968
 (However, I hope that in the new firmware there are no problems with 32 GB memory cards).
In addition, judging by the reports of the developers, in the fourth version of Raspberry the algorithm for working with memory cards was changed. In particular, options for memory cards can no longer be configured in config.txt. Previously, I could change the frequency for memory cards, which helped me speed up the computer.
Based on this, I conclude that the fourth version of Raspberry is "more sensitive" to memory cards than the third version. I don’t have other information and I can’t say whether the “sensitivity” of the fourth version is related to some hardware features (for example, changing the architecture of Raspberry, due to which the computer is now fast and efficient, also supports usb3 and has a new lan chip ) But nevertheless, I personally buy more expensive and high-quality memory cards than before =) Also, I bought a new and expensive external box for an ssd disk due to a known problem with uasp =) Efficiency requires new investments.

hippy
Posts: 6862
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 4:44 pm

Thanks. I tend to just use whatever cards I pick up cheap as card performance has never really been an issue for me but I'll bear that in mind if I do start experiencing any odd problems.

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 5:00 pm

Seems the issue with 32Gb cards was resolved before the end of the thread...

https://www.raspberrypi.org/forums/view ... 5#p1528154
brohan wrote: Got a replacement pi today. It boots off all 32gb and the 64gb cards that the other didn't. It was a pi issue
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25466
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Wed Dec 25, 2019 10:30 pm

AFAIK there are no real differences in the SD card interface between the 4 and previous versions.

There may be clocking changes but they will not affect the standard performance, and there are no regressions over earlier performance.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

renice123
Posts: 165
Joined: Tue Oct 15, 2019 3:56 pm

Re: RPi 4 4GB CPU spikes and 'freezes' for a up to 5 seconds.

Thu Dec 26, 2019 7:10 pm

I’m just not struggling to increase productivity, but trying to reduce productivity.
I have several microcomputers and some of them I use in headless mode to solve specific, non-resource-intensive tasks. Teensy controllers are also connected to them.
For Raspberries 3 there are many ways to reduce performance, including changing the frequency for a memory card. If you apply all the known ways to reduce productivity, Raspberry 3 works very well, stably, but slowly. This is what I need - power consumption is reduced, also Raspberry is absolutely cold even in a closed drawer.
I think the fourth version of Raspberry can change the power consumption modes even more flexibly (due to the peculiarities of the architecture), but for some reason the ability to work with the clock frequency for memory cards was disabled. Of course, this is not so important, but still ...
Personally, I am pleased to know that the Raspberry 3 can be flexibly changed, up to disconnecting USB controllers. In theory, the Raspberry 4 should have the ability to disconnect the USB controller, while the network controller will work

Return to “Troubleshooting”