comparison OrthancServer/Resources/ImplementationNotes/memory_consumption.txt @ 5157:874e6b135614

doc
author Alain Mazy <am@osimis.io>
date Thu, 02 Feb 2023 09:40:48 +0100
parents 2020c2e479d3
children 02cfd23a556a
comparison
equal deleted inserted replaced
5156:2020c2e479d3 5157:874e6b135614
27 27
28 Each Orthanc container is limited to 400MB (through the docker-compose configuration 28 Each Orthanc container is limited to 400MB (through the docker-compose configuration
29 `mem_limit: 400m`) 29 `mem_limit: 400m`)
30 5 large studies are uploaded to each instance of Orthanc (around 1GB in total). 30 5 large studies are uploaded to each instance of Orthanc (around 1GB in total).
31 Each study is anonymized manually, one by one and then, we repeat the operation. 31 Each study is anonymized manually, one by one and then, we repeat the operation.
32 We compare the memory used by the containers after 2 minutes of execution 32 We compare the memory used by the containers after each anonymization
33 (using `docker stats`): 33 (using `docker stats`):
34 34
35 # study without malloc_trim with_malloc_trim 35 # study without malloc_trim with_malloc_trim
36 0 ~ 50 MB ~ 50 MB 36 0 ~ 50 MB ~ 50 MB
37 1 ~ 140 MB ~ 140 MB 37 1 ~ 140 MB ~ 140 MB
67 67
68 68
69 Conclusion: 69 Conclusion:
70 ---------- 70 ----------
71 71
72 The use of malloc_trim does not guarantee that Orthanc will never reach a 72 The use of malloc_trim reduces the overall memory consumption of Orthanc
73 and avoids some of the out-of-memory situations.
74
75 However, it does not guarantee that Orthanc will never reach a
73 out-of-memory error, especially on very constrained systems. 76 out-of-memory error, especially on very constrained systems.
77
74 Depending on the allocation pattern, the Orthanc memory can get 78 Depending on the allocation pattern, the Orthanc memory can get
75 very fragmented and increase since malloc_trim only releases memory 79 very fragmented and increase regularly since malloc_trim only releases memory
76 at the end of each of malloc arena. However, note that, even long before the 80 at the end of each of malloc arena. However, note that, even long before the
77 introduction of malloc_trim, we have observed Orthanc instances running for years 81 introduction of malloc_trim, we have observed Orthanc instances running for years
78 without ever reaching out-of-memory errors and Orthanc is usually considered as 82 without ever reaching out-of-memory errors and Orthanc is usually considered as
79 very stable. 83 very stable.
80 84
85 Moreover, before each release, Orthanc integration tests are run against Valgrind
86 and no memory leaks have been identified.
81 87
82 88
83 malloc_trim documentation 89 malloc_trim documentation
84 ------------------------- 90 -------------------------
85 91