首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

cmake:动态链接库(so)中静态链接tcmalloc(gperftools2.4)暨静态链接libstdc++

将tcmalloc作为动态库使用,非常方便,网上有很多资料介绍了。tcmalloc.a也可以以静态链接的方式加入应用程序中,大概因为使用太方便,网上关于这方面的介绍都是一笔带过,但是如果要在动态 库(so)中静态编译tcmalloc,却是有所不同的。 我的项目中有一个so动态库,需要在java中通过jni调用,因为涉及频繁的内存分配操作所以这个so希望用tcmalloc管理内存池以提高系统运行效率,如果使用以动态库方式使用tcmalloc。那么在应用服务器(tomcat)启动的时候,需要先设置LD_PRELOAD参数指向tcmalloc.so,然后执行startup.sh启动tomcat。这样以来,不仅是我的so库,整java程序在运行过程中的所有向操作系统申请释放内存的过程都交给了tcmalloc管理了,其实挺好的。使用这种方案,我的so库代码不需要在编译时链接tcmalloc,什么都不用改变,就能使用tcmalloc。 但是凡事有利就有弊,这个方案带的成本就是在系统安装、维护时稍显复杂:需要在服务器上安装tcmalloc和libunwind(应用系统运行在64位操作系统下),还可能需要修改tomcat启动脚本以加入LD_PRELOAD参数,对工程实施人员的要求比较高。

01

Check for working CXX compiler using: Visual Studio 10

Check for working CXX compiler using: Visual Studio 10 Check for working CXX compiler using: Visual Studio 10 – works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done ERRORNeither ‘svn’ nor ‘git’ as SCM found Git branch Build CGAL from git-branch: n/a Removed not-a-package: .gitattributes;.gitignore;out Installation package directory: D:/Cgal/cgal-releases-CGAL-4.0_vs2005/Installation Maintenance package directory: D:/Cgal/cgal-releases-CGAL-4.0_vs2005/Maintenance Core package directory: D:/Cgal/cgal-releases-CGAL-4.0_vs2005/Core Packagenames: AABB_tree;Algebraic_foundations;Algebraic_kernel_d;Algebraic_kernel_for_circles;Algebraic_kernel_for_spheres;Alpha_shapes_2;Alpha_shapes_3;Apollonius_graph_2;Approximate_min_ellipsoid_d;Arithmetic_kernel;Arrangement_on_surface_2;BGL;Boolean_set_operations_2;Box_intersection_d;CGAL_ipelets;CGALimageIO;Cartesian_kernel;Circular_kernel_2;Circular_kernel_3;Circulator;Combinatorial_map;Conic_2;Convex_decomposition_3;Convex_hull_2;Convex_hull_3;Convex_hull_d;Core;Developers_manual;Distance_2;Distance_3;Envelope_2;Envelope_3;Filtered_kernel;Generator;Geomview;GraphicsView;HalfedgeDS;Hash_map;Homogeneous_kernel;Installation;Interpolation;Intersections_2;Intersections_3;Interval_skip_list;Interval_support;Inventor;Jet_fitting_3;Kernel_23;Kernel_d;Kinetic_data_structures;LEDA;Largest_empty_rect_2;Linear_cell_complex;MacOSX;Maintenance;Manual;Manual_tools;Matrix_search;Mesh_2;Mesh_3;Min_annulus_d;Min_circle_2;Min_ellipse_2;Min_quadrilateral_2;Min_sphere_d;Min_sphere_of_spheres_d;Minkowski_sum_2;Minkowski_sum_3;Modifier;Modular_arithmetic;Nef_2;Nef_3;Nef_S2;Number_types;OpenNL;Optimisation_basic;Optimisation_doc;Partition_2;Periodic_3_triangulation_3;Point_set_2;Point_set_processing_3;Polygon;Polyhedron;Polyhedron_IO;Polynomial;Polytope_distance_d;Principal_component_analysis;Profiling_tools;QP_solver;Qt_widget;Random_numbers;Ridges_3;Robustness;STL_Extension;Scripts;SearchStructures;Segment_Delaunay_graph_2;Skin_surface_3;Snap_rounding_2;Solver_interfa

02
领券