Home » Guides » Chia Runtime Error Bad Allocation Fix

Chia ‘Runtime Error: Bad Allocation’ Fix

Here's how to fix the Chia Runtime Error Bad Allocation error in Windows.

Chia is a new green cryptocurrency developed by Bram Cohen, one of the famous names in the Tech world. It mints new coins in a less energy-intensive manner. If you have already installed Python 3.9.4 and synced the blockchain in the Chia client but you are getting RunTime Error: Bad Allocation when you try to plot Chia, here’s how to fix it in your Windows PC.

How to Fix Chia Windows Runtime Bad Allocation Error?

To fix the Chia Runtime Error Bad Allocation error in Windows you need to know how many cores does your CPU have and how much RAM do you have? Also, what plotting settings do you use? A minimum size plot demands approximately 101Gb of storage capacity and 4GB of RAM, so storing 100 K32 plots demands a device with partially more than 10TB of storage capacity. Creating 100 plots in parallel will need 400GB of machine memory, as each plot takes 4GB of DRAM to create. So keeping these in mind here’s how to fix the Chia Runtime Error Bad Allocation error in Windows:

Type RAM size as GiB converted from GB

Users sometimes make the mistake of entering their complete RAM size in the Chia client. Your RAM is counted in GB, while the client uses GiB. There are two values that look very similar but are vastly different. You can get a Bad Allocation Runtime Error if you have a 64 GB RAM setup and enter 64 GiB in the client. 64 gigabytes of RAM equates to 68.7195 gigabytes of RAM. As a result, double-check if you’re using the correct units in the client. To set the GiB value according to your machine’s usable RAM, use Google or any other online converter.

Do Not Assign Full Resources of PC

You can not use all of the RAM in your computer because the OS needs some RAM. If you use all or most of the RAM, the computer will become sluggish. To plot a minimum size plot, you’ll need 4GB of RAM, so multiply that amount by the number of plots you want to process in parallel. As a result, make sure you have enough RAM for Windows to run smoothly. They’ll be essential for writing and storing data on your SSD or HDD.

Similarly, if you want to plot several plots in conjunction, don’t give the client all of those cores. For the PC’s simple operation, you’ll need at least one or two cores free. So, if your CPU has eight cores and sixteen threads, you should only use just fourteen of them to process these seven chia plots in parallel.

Adjust Performance in Control Panel

Try to run the plot again. If you still getting the error, then in the Windows start menu, type “performance” and then press on adjust the appearance and performance of Windows (directs to Control Panel). Now go to the advanced tab and select “Change” from the virtual memory drop-down menu. Change the “windows managed” number in this C pagefile to a number equal to the number of plots you have.

Launch Plots in Phased Order to Fix Chia Runtime Bad Allocation Error

Alternatively, you might also consider launching simultaneous plots in a timely phased order. When you use your PC’s full capacity all at once, the OS can stutter and create a number of bad allocations. To correct this, launch 70-80% of the power at the same time. Once you’ve checked the current plot status by clicking on the view log, double-check that they aren’t showing you the bad allocation error now that phase 2 has begun.

That’s everything you needed to know about how to fix the Chia Runtime Error Bad Allocation error in Windows. And for all the latest Tech guides, check out our Guides section on TechNclub.