# HG changeset patch # User Alain Mazy # Date 1675326878 -3600 # Node ID 2020c2e479d3df55cadd459565b18865780e8de2 # Parent 20911302c6e73df70236b529b5791f7a1b4cb2bd doc diff -r 20911302c6e7 -r 2020c2e479d3 OrthancServer/Resources/ImplementationNotes/memory_consumption.txt --- a/OrthancServer/Resources/ImplementationNotes/memory_consumption.txt Wed Feb 01 19:32:14 2023 +0100 +++ b/OrthancServer/Resources/ImplementationNotes/memory_consumption.txt Thu Feb 02 09:34:38 2023 +0100 @@ -2,6 +2,7 @@ tries to give back unused memory back to the system. This is implemented by calling malloc_trim every 100ms. + Here is how we validated the effect of this new feature: ------------------------------------------------------- @@ -9,6 +10,7 @@ on Feb 1st 2023. One image without the call to malloc_trim and the other with this call. + 1st test: unconstrained Docker containers ......................................... @@ -19,6 +21,7 @@ - without malloc_trim: 1500 MB - with malloc_trim: 410 MB + 2nd test: memory constrained Docker containers .............................................. @@ -37,7 +40,8 @@ 4 out-of-memory crash ~ 345 MB 5..20 ~ 380 MB (stable) -3nd test: memory constrained Docker containers + +3rd test: memory constrained Docker containers .............................................. In this last test, we lowered the memory allocation to 300MB and have been able to @@ -49,8 +53,21 @@ The same test without malloc_trim could never run for more than 35 seconds. -Note: ----- +4th test: performance impact of malloc_trim and available memory +................................................................ + +In this test, we have measured the time required to anonymize a 2000 instances study +with various configurations. It appears that malloc_trim or the total amount +of memory available in the system has no significant impact of performance. + +- No malloc trim, 300 MB in the system: ~ 38s +- No malloc trim, 1500 MB in the system: ~ 38s +- With malloc trim, 300 MB in the system: ~ 38s +- With malloc trim, 1500 MB in the system: ~ 38s + + +Conclusion: +---------- The use of malloc_trim does not guarantee that Orthanc will never reach a out-of-memory error, especially on very constrained systems. @@ -63,9 +80,6 @@ - - - malloc_trim documentation -------------------------