# Memory allocation of bytes failed (Advanced CLI May-01)

**URL:** <https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328>\
**Category:** Support\
**Created:** [May 3, 2024, 7:17am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328 "2024-05-03T07:17:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![micar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/micar/32/3037_2.png) [@micar](https://forum.autonomys.xyz/u/micar)\
**Post date:** [May 3, 2024, 7:17am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/1 "2024-05-03T07:17:30Z")

</div>

## Issue Report

Initial plotting failed with error “memory allocation of bytes failed”.

> **Node-1**
>
> PS C:\Subspace\> .\subspace-farmer-windows-x86\_64-skylake-gemini-3h-2024-may-01.exe farm --record-encoding-concurrency 3 path=D:\Subspace\farms\_99,size=1000GB  
> 2024-05-01T21:25:45.224455Z INFO subspace\_farmer::commands::farm: Preparing plotting thread pools plotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-23), .. }] replotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-11), .. }]  
> …  
> 2024-05-02T05:55:49.005445Z INFO {farm\_index=0}: subspace\_farmer::single\_disk\_farm::plotting: Plotting sector (64.21% complete) sector\_index=601  
> memory allocation of memory allocation of 10486721048672memory allocation of bytes failed  
> bytes failed

> **Node-2**
>
> PS C:\Subspace\> .\subspace-farmer-windows-x86\_64-skylake-gemini-3h-2024-may-01.exe farm --reward-address --record-encoding-concurrency 4 path=H:\Subspace\farms\_20,size=1000GB  
> 2024-05-01T21:18:40.382750Z INFO subspace\_farmer::commands::farm: Preparing plotting thread pools plotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-23), .. }] replotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-11), .. }]  
> 2024-05-02T02:28:12.701999Z INFO {farm\_index=0}: subspace\_farmer::single\_disk\_farm::plotting: Plotting sector (4.27% complete) sector\_index=40  
> 2024-05-02T02:30:30.979817Z INFO {farm\_index=0}: subspace\_farmer::single\_disk\_farm::plotting: Plotting sector (4.38% complete) sector\_index=41  
> memory allocation of memory allocation of memory allocation of memory allocation of memory allocation of  
> thread ’  
> thread '10487121048712104871210487121048712tokio-runtime-workertokio-runtime-worker bytes failed  
> bytes failed
> 
> PS C:\Subspace\> .\subspace-farmer-windows-x86\_64-skylake-gemini-3h-2024-may-01.exe farm path=H:\Subspace\farms\_20,size=1000GB  
> 2024-05-02T15:09:14.476366Z INFO subspace\_farmer::commands::farm: Preparing plotting thread pools plotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-23), .. }] replotting\_thread\_pool\_core\_indices=[CpuCoreSet { cores: CpuSet(0-11), .. }]  
> 2024-05-02T16:40:04.524814Z INFO {farm\_index=0}: subspace\_farmer::single\_disk\_farm::plotting: Plotting sector (5.77% complete) sector\_index=54  
> memory allocation of 1048672 bytes failed

### Environment

subspace-farmer-windows-x86\_64-skylake-gemini-3h-2024-may-01.exe

Node-1  
I7-13700/32GB/8TB SSD/WIN11 23H2

Node-2  
I7-13700F/32GB/16TB SSD/WIN11 23H2

Node-3  
Threadripper 2950X/128GB/32TB SSD/WIN11 23H2

### Problem

Memory allocation failed during initial plotting on servers on Node-1 and Node-2.  
Node-3 works fine.  
Looks like a memory leak. When stoped plotting on Node-3 total memory consumpion drops from 59GB to 14GB.

---

<div class="post-metadata">

**Author:** ![PuNkYsHuNgRy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/punkyshungry/32/541_2.png) [@PuNkYsHuNgRy](https://forum.autonomys.xyz/u/PuNkYsHuNgRy)\
**Post date:** [May 3, 2024, 3:46pm UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/2 "2024-05-03T15:46:52Z")

</div>

Thanks so much for reporting this! @nazar-pc

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [May 3, 2024, 5:58pm UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/3 "2024-05-03T17:58:01Z")

</div>

I do not expect there to be a memory leak, but there might be a higher memory usage due to higher plotting concurrency in last releases.

How much memory does farmer use on i7 machines? Do you have anything else running there that can consume a lot of memory? I need more information.

---

<div class="post-metadata">

**Author:** ![micar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/micar/32/3037_2.png) [@micar](https://forum.autonomys.xyz/u/micar)\
**Post date:** [May 4, 2024, 7:35am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/4 "2024-05-04T07:35:45Z")

</div>

I did some more research and found that memory keeps growing during plotting. On I7 machines farmer reached peak of 20Gb in 3 hours after start and then error appeared. On threadripper farmer reached 53GB after 10 hours and keep it even after plotting has finished (see screenshots).

> **Threadripper**
>
> ![farmer](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/6/66301fabc04b9ac82e1b2a3d222aee55c1d75010.png)
> 
> ![memory](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/7/7e48f9595b33e37dec66b68c13fcccaed0f3d863.png)

My previous version was Mar-29 and everithing works fine. Peak memory consumtion for node + farmer was around 15Gb on each machine. Also I tried to decrise “–record-encoding-concurrency” from 4 to 3 but I don’t see that its helps to fix problem.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [May 4, 2024, 7:57am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/5 "2024-05-04T07:57:04Z")

</div>

Got it, will take a closer look then

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [May 4, 2024, 8:54am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/6 "2024-05-04T08:54:06Z")

</div>

I initiated build from the `main`branch that has some tweaks, can you check if it helps with memory usage during plotting when it is built?: [Snapshot build · subspace/subspace@3494834 · GitHub](https://github.com/subspace/subspace/actions/runs/8949356737)

It should also significantly reduce memory usage once plotting is over instead of keeping memory to itself.

---

<div class="post-metadata">

**Author:** ![micar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/micar/32/3037_2.png) [@micar](https://forum.autonomys.xyz/u/micar)\
**Post date:** [May 4, 2024, 9:06am UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/7 "2024-05-04T09:06:37Z")

</div>

Thanks! I will try it today and provide results.

UPD:  
This build looks much better for me. After 4 hours plotting farmer consume ~14Gb and not growing. Total memory consumtion (win + node + farmer) on I7 system is about 25Gb, so errors are gone.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [May 6, 2024, 6:23pm UTC](https://forum.autonomys.xyz/t/memory-allocation-of-bytes-failed-advanced-cli-may-01/3328/8 "2024-05-06T18:23:41Z")

</div>

The change of test build is included in the latest release [Release gemini-3h-2024-may-06 · subspace/subspace · GitHub](https://github.com/subspace/subspace/releases/tag/gemini-3h-2024-may-06)
