3

I'm trying to render something with blender, but it's taking 20gb of RAM! I don't have that, so I just plug in a 60gb usb stick, and mount it as swap space.

The problem is that now I can't really use my computer for anything since traditional RAM is completely full all the time.

Is it possible to assign blender to use JUST swap? Or just the usb stick (/dev/sdf1)?

3 Answers 3

2

About swapping

A USB stick does not work well for swapping. The hardware (memory cells) is slow, and sensitive to wear (the expected lifetime in number of write cycles is low compared to other hardware). An HDD or SSD is better, but if you need fairly fast processing, increased RAM is the solution.

Renice the Blender process(es)

If you want to use the computer for other tasks while rendering, you can renice Blender (a high niceness value will give it low priority, so that other application programs will get priority to use the CPU and RAM).

The command line tool renicecan manage the niceness between -20 and 19, where 19 is the 'nicest' value visavi the other tasks alias lowest priority. You need elevated permissions (use sudo for text mode programs and sudo -H for GUI programs) to decrease the niceness. See

man renice

Users other than the superuser may only alter the priority of processes they own, and can only monotonically increase their 'nice value' (for security reasons) within the range 0 to 19, unless a nice resource limit is set (Linux 2.6.12 and higher). The superuser may alter the priority of any process and set the priority to any value in the range -20 to 19. Useful priorities are: 19 (the affected processes will run only when nothing else in the system wants to), 0 (the ``base'' scheduling priority), anything negative (to make things go very fast).

It may be more convenient to install and use htop to increase the niceness of your blender process(es),

sudo apt install htop

The screenshot shows how I have reniced the htop process itself (from 0) to 5.

enter image description here

  1. Select process (in your case Blender process)

  2. Renice to a suitable value in the range 0–19

  3. The current niceness is shown in the 'NI' column

0

Have a look at cgexec to limit a processes resource usage, this example may help.

One option is to start rendering and go to bed, then let it continue while you are out at work/school... Using 20GB to render is pretty high, a better question which you could ask at blender.stackexchange is how to reduce the memory needed to render. Maybe you can bake a high res sculpt to a normal map, use lower res image textures, use render layers to render different parts of your scene separately and composite them together.

0

Swap is not a replacement for RAM! Programs eventually run on RAM irrespective of how much swap space you assign. Moreover, using more swap will make the pc dead slow. BTW, what are you rendering? Think about optimising your project instead.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .