Re: How to signal kernel that shared library is not in use by any process anymore ?

2019-01-08 Thread Lev Olshvang
Hi Lior thanks for your time and code example. Shachar Shemesh explained to me couple of simple things I forgotten. You can find his replies in this thread but the bottom line : I do not need to signal kernel.Kernel memory manager will discover that pages are not active ( each page have active

Re: How to signal kernel that shared library is not in use by any process anymore ?

2019-01-05 Thread Shachar Shemesh
On 05/01/2019 10:36, Lev Olshvang wrote: Since I knew that mmap needs file descriptor I assumed ( and did not checked man page)  that munmap need file descriptor. That's not true either, actually. Mmap absolutely does not need a file

Re: How to signal kernel that shared library is not in use by any process anymore ?

2019-01-05 Thread Lev Olshvang
Shachar , you are 100%/ right ! Since I knew that mmap needs file descriptor I assumed ( and did not checked man page)  that munmap need file descriptor. Great !!Thanks, Thanks,  Thanks!  04.01.2019, 22:30, "Shachar Shemesh" : On 27/12/2018 15:34, Lev Olshvang wrote:Can you elaborate why I can not

Re: How to signal kernel that shared library is not in use by any process anymore ?

2019-01-04 Thread Shachar Shemesh
On 27/12/2018 15:34, Lev Olshvang wrote: Can you elaborate why I can not write new system call to unmap this memory regions,  which I see in /proc/self/maps  by force ? Why would you need a system call to do this? Well,

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-27 Thread Lev Olshvang
Shahar, Thank you very much.I am going to use your advise ( actually I am advising on this to other team but I will ping them until they change static mapping to dynamic in their build system) I will update the list on the results but your are absolutely correct that memory manager will do

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-26 Thread Lev Olshvang
Hello Greg, Thanks for you your reply. It help me to better express my question From the application I can access /proc/self/maps and see which memory is mapped for my library I do not intend to use after application passes init phase. I would like to unmap this memory region, but since I do

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-23 Thread Shachar Shemesh
On 23/12/2018 09:49, Lev Olshvang wrote: Boker tov,   Thanks for all of your replies that helped me to understand what question I really wanted to ask.   So this is a question.   I have  C++ program

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-22 Thread Lev Olshvang
Boker tov, Thanks for all of your replies that helped me to understand what question I really wanted to ask. So this is a question. I have  C++ program which calls many services of third party library.This library is needed only on initialization phase of my program.  Linker has resolved symbols

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-21 Thread Evgeniy Ginzburg
Also if we are speaking Linux, the OS in general have very aggressive caching policy. Everything is remains in cache until it it fills up or it cleaned up externally. AFAIK there's no negative effects on performance. That is not touching the programming that I know little about. BR Evgeniy. On

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-21 Thread Shachar Shemesh
On 21/12/2018 16:20, Lev Olshvang wrote: Hi All, I have an executable (C++) which is the exclusive user of the some shared library that it uses only during the initialization phase. I would like to free memory used by this shared library, because I am running

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-21 Thread Lior Okman
On Fri, Dec 21, 2018 at 4:21 PM Lev Olshvang wrote: > > Hi All, > > I have an executable (C++) which is the exclusive user of the some shared > library that it uses only during the initialization phase. > > I would like to free memory used by this shared library, because I am > running on