# Option disk space recycling no clear

**URL:** https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144
**Category:** General
**Created:** [December 16, 2023, 8:51pm UTC](https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144 "2023-12-16T20:51:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![abenavidescr](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/abenavidescr/32/1735_2.png) [@abenavidescr](https://discourse.orthanc-server.org/u/abenavidescr)
#### Post date: [December 16, 2023, 8:51pm UTC](https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144/1 "2023-12-16T20:51:07Z")

</div>

Regarding space recycling in the [official documentation](https://orthanc.uclouvain.be/book/faq/features.html) said:

> “… Recycling is controlled by the MaximumStorageSize and the MaximumPatientCount options in the Orthanc configuration file. Setting both these values to 0 will disable recycling …”

But when run Orthanc, de log messages show:

```auto
MAIN ServerIndex.cpp:381] No limit on the number of stored patients
MAIN ServerIndex.cpp:401] No limit on the size of the storage area
MAIN ServerIndex.cpp:420] Maximum Storage mode: Recycle

```

So, in my understand this is a `Maximum Storage mode: Protection` or something else. Is very confusing understand exactly what this message means.

---

<div class="post-metadata">

### Author: ![abenavidescr](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/abenavidescr/32/1735_2.png) [@abenavidescr](https://discourse.orthanc-server.org/u/abenavidescr)
#### Post date: [December 16, 2023, 8:56pm UTC](https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144/2 "2023-12-16T20:56:28Z")

</div>

I just saw in the [repository](https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.1/OrthancServer/Resources/Configuration.json) the new parameter:  
`"MaximumStorageMode" : "Recycle"`

---

<div class="post-metadata">

### Author: ![abenavidescr](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/abenavidescr/32/1735_2.png) [@abenavidescr](https://discourse.orthanc-server.org/u/abenavidescr)
#### Post date: [December 16, 2023, 9:01pm UTC](https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144/3 "2023-12-16T21:01:56Z")

</div>

I would add the `Protected` option additionally:  
`"MaximumStorageMode" : "Protected"`

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [December 18, 2023, 8:57am UTC](https://discourse.orthanc-server.org/t/option-disk-space-recycling-no-clear/4144/4 "2023-12-18T08:57:37Z")

</div>

Hi Alejandro,

I understand that this is not clear. I tried to clarify it both in the orthanc-book and in the code by not displaying this log if it is actually no relevant:

- [orthanc: 68e9f7815fb8](https://orthanc.uclouvain.be/hg/orthanc/rev/68e9f7815fb8)
- [orthanc-book: bd7fbe3042f7](https://orthanc.uclouvain.be/hg/orthanc-book/rev/bd7fbe3042f7)

To summarize:

- `MaximumStorageMode` is taken into account only if you have set a `MaximumStorageSize != 0` or a `MaximumPatientCount != 0`
- to protect a patient, you must explicitly send a PUT command on `/patients/../protected`
- if you have not set any maximum size, your patients will never be deleted but they might be, in the future, if you set a maximum size.

HTH,

Alain.
