Heavy memory leaks (500 MB per loaded repo) #1

Closed
opened 2023-10-03 18:21:11 +03:00 by asheplyakov · 3 comments

After loading x86_64 python process consumes ~ 1 GB of RAM. The only way to reclaim that memory is to terminate the process (which is very inconvenient - lots of context gets lost).
valgrind reports

==3066422== 525,335,902 (4,003,200 direct, 521,332,702 indirect) bytes in 100,080 blocks are definitely lost in loss record 4,314 of 4,314                                                                                                    
==3066422==    at 0x48411E8: calloc (vg_replace_malloc.c:1117)                                                         
==3066422==    by 0x58F7F5B: rcalloc (in /usr/lib64/librpmio.so.7.0.1)                                                 
==3066422==    by 0x586405B: headerImport (in /usr/lib64/librpm.so.7.0.1)                                              
==3066422==    by 0x586502C: headerRead (in /usr/lib64/librpm.so.7.0.1)                                                
==3066422==    by 0x582E8D0: ??? (in /usr/lib64/python3/site-packages/rpm/_rpm.cpython-39.so)                          
==3066422==    by 0x4988575: type_call (typeobject.c:1014)                                                             
==3066422==    by 0x499A795: _PyObject_MakeTpCall (call.c:191)                                                         
==3066422==    by 0x48D5CF8: UnknownInlinedFun (abstract.h:116)                                                        
==3066422==    by 0x48D5CF8: UnknownInlinedFun (abstract.h:103)                                                        
==3066422==    by 0x48D5CF8: UnknownInlinedFun (abstract.h:127)                                                        
==3066422==    by 0x48D5CF8: UnknownInlinedFun (ceval.c:5072)                                                          
==3066422==    by 0x48D5CF8: _PyEval_EvalFrameDefault (ceval.c:3518)                                                   
==3066422==    by 0x48D8F42: UnknownInlinedFun (pycore_ceval.h:40)                                                     
==3066422==    by 0x48D8F42: function_code_fastcall (call.c:330)                                                       
==3066422==    by 0x48D5ADD: UnknownInlinedFun (abstract.h:118)                                                        
==3066422==    by 0x48D5ADD: UnknownInlinedFun (abstract.h:127)                                                        
==3066422==    by 0x48D5ADD: UnknownInlinedFun (ceval.c:5072)                                                          
==3066422==    by 0x48D5ADD: _PyEval_EvalFrameDefault (ceval.c:3518)                                                   
==3066422==    by 0x4A92AE6: UnknownInlinedFun (pycore_ceval.h:40)                                                     
==3066422==    by 0x4A92AE6: _PyEval_EvalCode (ceval.c:4327)                                                           
==3066422==    by 0x4A9628D: _PyFunction_Vectorcall (call.c:396)                                                       
==3066422==                                                                                                            
==3066422== LEAK SUMMARY:                                                                                              
==3066422==    definitely lost: 5,399,715 bytes in 100,336 blocks                                                      
==3066422==    indirectly lost: 521,332,702 bytes in 399,351 blocks                                                    
After loading `x86_64` python process consumes ~ 1 GB of RAM. The only way to reclaim that memory is to terminate the process (which is very inconvenient - lots of context gets lost). valgrind reports ``` ==3066422== 525,335,902 (4,003,200 direct, 521,332,702 indirect) bytes in 100,080 blocks are definitely lost in loss record 4,314 of 4,314 ==3066422== at 0x48411E8: calloc (vg_replace_malloc.c:1117) ==3066422== by 0x58F7F5B: rcalloc (in /usr/lib64/librpmio.so.7.0.1) ==3066422== by 0x586405B: headerImport (in /usr/lib64/librpm.so.7.0.1) ==3066422== by 0x586502C: headerRead (in /usr/lib64/librpm.so.7.0.1) ==3066422== by 0x582E8D0: ??? (in /usr/lib64/python3/site-packages/rpm/_rpm.cpython-39.so) ==3066422== by 0x4988575: type_call (typeobject.c:1014) ==3066422== by 0x499A795: _PyObject_MakeTpCall (call.c:191) ==3066422== by 0x48D5CF8: UnknownInlinedFun (abstract.h:116) ==3066422== by 0x48D5CF8: UnknownInlinedFun (abstract.h:103) ==3066422== by 0x48D5CF8: UnknownInlinedFun (abstract.h:127) ==3066422== by 0x48D5CF8: UnknownInlinedFun (ceval.c:5072) ==3066422== by 0x48D5CF8: _PyEval_EvalFrameDefault (ceval.c:3518) ==3066422== by 0x48D8F42: UnknownInlinedFun (pycore_ceval.h:40) ==3066422== by 0x48D8F42: function_code_fastcall (call.c:330) ==3066422== by 0x48D5ADD: UnknownInlinedFun (abstract.h:118) ==3066422== by 0x48D5ADD: UnknownInlinedFun (abstract.h:127) ==3066422== by 0x48D5ADD: UnknownInlinedFun (ceval.c:5072) ==3066422== by 0x48D5ADD: _PyEval_EvalFrameDefault (ceval.c:3518) ==3066422== by 0x4A92AE6: UnknownInlinedFun (pycore_ceval.h:40) ==3066422== by 0x4A92AE6: _PyEval_EvalCode (ceval.c:4327) ==3066422== by 0x4A9628D: _PyFunction_Vectorcall (call.c:396) ==3066422== ==3066422== LEAK SUMMARY: ==3066422== definitely lost: 5,399,715 bytes in 100,336 blocks ==3066422== indirectly lost: 521,332,702 bytes in 399,351 blocks ```
Author
https://bugzilla.redhat.com/show_bug.cgi?id=1358467
Author

Предположительно проблема устраняется этим патчем

Предположительно проблема устраняется [этим патчем](https://github.com/rpm-software-management/rpm/commit/40326b5724b0cd55a21b2d86eeef344e4826f863.patch)
Owner

fixed in recent rpm-build.

fixed in recent rpm-build.
iv closed this issue 2024-11-08 19:15:02 +03:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: iv/repos-cmp#1
No description provided.