A dumb question for memory. libQuantlib.so in Linux 300+M, Is there a way to reduce it memory footprint if I only use one or two of it function?
|
Hi Steve,
Emmm... seems not be so easy. Anyway .so file will only consume your hard disk not your RAM. On modern machine 300M+ hard disk is not a big deal. In our company we even deliver quantlib in virtual machine which stands on a physical machine (at most 100+ virtual in 1 physical). The only way to reduce the size of .so file is to reduce the functionality it contains I think. You can try to filter out the necessary functions and exclude other functions and rebuilt the whole project. Regards, Cheng -----邮件原件----- 发件人: SteveGe [mailto:[hidden email]] 发送时间: 2015年1月4日 19:21 收件人: [hidden email] 主题: [Quantlib-users] Quantlib dynamic library size A dumb question for memory. libQuantlib.so in Linux 300+M, Is there a way to reduce it memory footprint if I only use one or two of it function? -- View this message in context: http://quantlib.10058.n7.nabble.com/Quantlib-dynamic-library-size-tp16145.ht ml Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by SteveGe
Hi Steve,
Another way to reduce the size of lib is to look at the .a static lib. .a file is simply a collection of .o files. You can unzip the .a file and choose your favorite .o files and re-archive them. However this way is dangerous and you have to keep the dependency of these . o files in mind. Regards, Cheng -----邮件原件----- 发件人: SteveGe [mailto:[hidden email]] 发送时间: 2015年1月4日 19:21 收件人: [hidden email] 主题: [Quantlib-users] Quantlib dynamic library size A dumb question for memory. libQuantlib.so in Linux 300+M, Is there a way to reduce it memory footprint if I only use one or two of it function? -- View this message in context: http://quantlib.10058.n7.nabble.com/Quantlib-dynamic-library-size-tp16145.ht ml Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by cheng li
Does that mean it only load a few K or Byte to memory even if the .so is 300+MByte? I am not sure that would be the case as .so is a file in its own not a collection of files like .a
Is there a way to verify that ? I tried pmap -x pid and checked the RSS but not sure that is the correct way. |
Hi Steve,
You can remove the -g option in compiling to skip debug information. This will reduce the file size significantly IMO. Regards, Cheng -----邮件原件----- 发件人: SteveGe [mailto:[hidden email]] 发送时间: 2015年1月6日 11:48 收件人: [hidden email] 主题: Re: [Quantlib-users] 答复: Quantlib dynamic library size Does that mean it only load a few K or Byte to memory even if the .so is 300+MByte? I am not sure that would be the case as .so is a file in its 300+own not a collection of files like .a Is there a way to verify that ? I tried pmap -x pid and checked the RSS but not sure that is the correct way. -- View this message in context: http://quantlib.10058.n7.nabble.com/Quantlib-dynamic-library-size-tp16145p16 155.html Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by SteveGe
Hi Steve,
Attached are the screen shot that test how much memory will be used when libQuantLib.so file is used. Here actually I import in the QuantLib-SWIG python wrapper which link to libQuantLib.so. (Actually this is our modified version which also import something like pandas, matplotlib , numpy at the same time, they all will cost memory usage). You will see the ipython reside memory increase from 18M to 100M+, and shared memory increase from less than 1M to 32M. Nevertheless the physical memory used are still less than 300M+. Regards, Cheng -----邮件原件----- 发件人: SteveGe [mailto:[hidden email]] 发送时间: 2015年1月6日 11:48 收件人: [hidden email] 主题: Re: [Quantlib-users] 答复: Quantlib dynamic library size Does that mean it only load a few K or Byte to memory even if the .so is 300+MByte? I am not sure that would be the case as .so is a file in its 300+own not a collection of files like .a Is there a way to verify that ? I tried pmap -x pid and checked the RSS but not sure that is the correct way. -- View this message in context: http://quantlib.10058.n7.nabble.com/Quantlib-dynamic-library-size-tp16145p16 155.html Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by cheng li
Thanks a lot Cheng, It is now only 20M after I run "strip libQuantlib.so.0.0.0"
So only 1/15 of the original size. And when it load to memory it would be no more than 20M. |
Free forum by Nabble | Edit this page |