Blender crashes – Pratical limits on RAM

Blender crashes when rendering scenes from Nature Academy? It’s likely that grass particles cause Blender to run out of RAM. While I have explained the theoretical RAM limits in an article before, this article is more about the practical limitations.

In general, I assume that you are using the 64 bit version of Windows and 64 bit version of Blender, which gives you a theoretical memory limit of 16 TB. But where does this huge amount of memory come from? It comes from the physical amount of RAM you have installed and the size of the page file (pagefile.sys).

Now, the page file can grow at maximum to the full size of your hard disk, which typically means that the limit is below 500 GB, which is far away from 16 TB. In the beginning, Windows will not make the page file so large – otherwise you would not be able to store anything else on your hard disk.

Windows starts at around 2 GB or 4 GB and expands the page file when needed. However, Windows might not be as fast at expanding the page file as Blender requests more memory. If this happens, Windows does not allow Blender to get more RAM and causes an Out-of-memory exception which crashes Blender.

Next time you start Blender, the page file is already bigger, e.g. 8 GB, and will be expanded again. It may then happen that Blender renders your scene as if it would never have had any problems. It might even happen that you can increase the particle count without any issues.

So what is the practical memory limit on your PC? In order to figure that out, I have written a small program which does nothing else than allocating memory. It does that in 4 MB pieces and it will recognize the limit before it actually crashes. It will then tell you, how much it was.

Be aware that running the program twice may cause different results. This is for mainly two reasons:

  • the page file has been expanded in the meanwhile (as explained before)
  • other programs running at the moment the memory limit is tested. This may also be invisible programs such as automatic update or virus scanners.

I’m sorry I have only German versions of the screen shots.

Download 64 bit memory test application

This program requires the .NET 2.0 framework to be already installed on your computer.

Blender and RAM

People were contacting me due to my articles about RAM in Blender (e.g. Just some more on crashes and Blender has stopped working). When I actually thought about it, it turned out that I saw a 3,2 GB peak in the 32 bit version of Blender. But how is that possible? But I am a software developer, so I needed to figure this out.

Technically, with a 32 bit pointer, 4 GB of RAM can be addressed. But: for managing all the stuff behind the scenes, Windows itself reserves half of it, so only 2 GB can actually be used. This is the bad truth on 32 bit operating systems I had to deal with very often in my career as a software developer.

There is only one chance to change it: the /3GB switch. It will tell Windows to reserve only 1 GB for managing the stuff so that there are 3 GB available for the applications. But: this must have been considered by the software developer before, so some applications will support this and benefit from the additional RAM and others don’t, so they will stick to 2 GB. The thing to know for the developer is “Large Address Aware”. Let’s see whether the 32 bit version of Blender is “Large Address Aware”:

So the answer is: yes, 32 bit Blender will benefit from the /3GB switch and use up to 3 GB of RAM on a 32 bit operating system.

On a 64 bit operating system, things change again. The reason is that Windows itself uses 64 bit pointers, so it can do the management somewhere far above the 4 GB limit. This means that there are full 4 GB available for programs which are “Large Address Aware”. Again, others will stick to 2 GB.

But on a 64 bit OS, you can also run the 64 bit version of Blender. This definitely won’t work on a 32 bit OS where you’ll see the following error message only. Running 64 bit Blender on 64 bit OS is definitely the best thing, because the limit is somewhere you’ll not have the money to reach it.

Ok, enough said, here’s the real truth, the table of available RAM for applications. The ones which apply for Blender are highlighted.

Now for those who have 4 GB physical RAM in their PC but own a 32 bit version of Windows only. How can you apply this magic /3GB switch? There are already other websites describing this for Windows XP and Vista. On Windows 7, run the following command at the command line prompt:

bcdedit /set IncreaseUserVa 3072

Anything to add? Share your thoughts via the comments function.

Blender has stopped working

Like other participants of the Nature Academy, I’m getting a Blender crash when rendering the scene with 100000 grass particles. My PC has 3,25 GB of RAM and additional 3,25 GB swap file. But what is this crash about?

First, it says it is an unhandled Win32 exception. Unhandled means the program will crash. When I attach a debugger, I can see that it is an access violation, error code 0xC0000005. Blender is trying to write at address 0×00000004, which is not valid memory (NullReferenceException).

In the call stack, I see there is Blender and a avcodec-52.dll, but unfortunately I don’t have symbols or anything else, so I can’t tell more about it. I think it occured during the “Preparing the scene” process, not during raytracing.

Does any Blender developer read this? If yes, can you answer the question whether or not you access crash dump data from Microsoft Windows Error Reporting to fix crashes like this? Then I could advise people to submit crash data to Microsoft so that we get more stable Blender versions in the future.

I retried with the swap file set to 16 GB but with the same result, so I’m gonna need a different solution. I cannot upgrade RAM itself because there’s a bug in my chipset – what a pitty.

My starting point

Just to give you an idea of what my Blender background is, I want to show you the first 3D graphic I totally made on my own. And it is actually a graphic which has been created with a specific usage in mind. It will support one of my other websites which is all about applications for employment.

As Blenderguru outlined in one of his announcements, it is ok to use external programs (other than Blender) as well. Because I am much better in drawing vector graphics with CorelDraw or Inkscape, I created an SVG graphic first and imported this for rendering in Blender. The glare on specular parts of the image is done with the compositor already.

I am using Blender for about two months now in my spare time only. In the evenings, I am watching Blenderguru’s tutorials and working on some of them. So from 3D point of view, I am a total beginner and I am glad Andrew provides the Nature Academy for additional learning. I aim at creating realistic renders, so the tutorial is just coming right for me.