Macbook restarts because of kernel panic restarts every 2-3 mins
Solution 1:
This type of kernel panic is most often caused by a defective RAM module.
The kernel panic is caused by a "general protection fault" in kernel mode. This means that the kernel (the core of the operating system) tried to access memory addresses that aren't mapped to physical RAM.
The cause of this is an invalid pointer. A pointer is basically a number stored in RAM that works as an address and "points to" a different piece of the system memory.
Invalid pointers can be caused by software bugs. However, a bug that causes a kernel panic every 2-3 minutes no matter the activity would almost certainly have been discovered by other users. Those type of software bugs that cause kernel panics are usually triggered by a specific action (such as inserting an external peripheral), and not something just happening randomly.
If you have third party kernel extensions installed - disable them to test if they have any part in the kernel panic. It is also a good idea to boot up in Recovery Mode and confirm that the kernel panics also happen here, in order to rule out third party software as a cause.
Invalid pointers can also be caused by defective RAM. This I think is the most common cause for invalid pointers happening "randomly" in kernel space with a production kernel.
There are also other, less common, causes of invalid pointers, such as for example a defective CPU, a damaged memory bus, and defective PCIe DMA units.