Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[allocator_tutorial] More global allocations used when intra-process is enabled #292

Open
sloretz opened this issue Dec 11, 2018 · 2 comments
Labels
question Further information is requested

Comments

@sloretz
Copy link
Contributor

sloretz commented Dec 11, 2018

Bug report

Required Info:

  • Operating System:
    • Ubuntu Bionic
  • Installation type:
    • debs
  • Version or commit hash:
    • crystal pre-release
  • DDS implementation:
    • Fast-RTPS, opensplice, connext
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

  1. Run the allocator_tutorial for 20 seconds without passing the argument to enable intra-process
    ros2 run demo_nodes_cpp allocator_tutorial & sleep 20 && kill -SIGINT %
    
  2. Run the allocator_tutorial for 20 seconds again with the argument to enable intra-process
    ros2 run demo_nodes_cpp allocator_tutorial intra & sleep 20 && kill -SIGINT %
    

Expected behavior

I think there should be fewer calls to Global New and Global Delete when using intra-process because the intra-process manager was given the custom allocator.

Actual behavior

There are many more calls to Global New when using the intra process pipeline

Fast-RTPS Intra-process off

$ RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run demo_nodes_cpp allocator_tutorial & sleep 20 && kill -SIGINT %
[1] 4581
Intra-process pipeline is OFF.
[INFO] [rclcpp]: signal_handler(signal_value=2)
Global new was called 45983 times during spin
Global delete was called 46029 times during spin
Allocator new was called 33107 times during spin
Allocator delete was called 33091 times during spin

Fast-RTPS Intra-process on

$ RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run demo_nodes_cpp allocator_tutorial intra & sleep 20 && kill -SIGINT %
[1] 4591
Intra-process pipeline is ON.
[INFO] [rclcpp]: signal_handler(signal_value=2)
Global new was called 93791 times during spin
Global delete was called 93706 times during spin
Allocator new was called 38952 times during spin
Allocator delete was called 36979 times during spin

Opensplice Intra-process off

$ RMW_IMPLEMENTATION=rmw_opensplice_cpp ros2 run demo_nodes_cpp allocator_tutorial & sleep 20 && kill -SIGINT %
[1] 4601
Intra-process pipeline is OFF.
[INFO] [rclcpp]: signal_handler(signal_value=2)
developer@aa39e14d1f14:~/workspaces/crystal$ Global new was called 18274 times during spin
Global delete was called 18244 times during spin
Allocator new was called 30880 times during spin
Allocator delete was called 30864 times during spin

Opensplice Intra-process on

$ RMW_IMPLEMENTATION=rmw_opensplice_cpp ros2 run demo_nodes_cpp allocator_tutorial intra & sleep 20 && kill -SIGINT %
[1] 4631
Intra-process pipeline is ON.
[INFO] [rclcpp]: signal_handler(signal_value=2)
developer@aa39e14d1f14:~/workspaces/crystal$ Global new was called 27184 times during spin
Global delete was called 27182 times during spin
Allocator new was called 36272 times during spin
Allocator delete was called 34433 times during spin

Connext Intra-process off

$ RMW_IMPLEMENTATION=rmw_connext_cpp ros2 run demo_nodes_cpp allocator_tutorial & sleep 20 && kill -SIGINT %
[1] 4661
Intra-process pipeline is OFF.
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User [email protected] For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
[INFO] [rclcpp]: signal_handler(signal_value=2)
Global new was called 7 times during spin
Global delete was called 5779 times during spin
Allocator new was called 32733 times during spin
Allocator delete was called 32717 times during spin

Connext Intra-process on

$ RMW_IMPLEMENTATION=rmw_connext_cpp ros2 run demo_nodes_cpp allocator_tutorial intra & sleep 20 && kill -SIGINT %
[1] 4688
Intra-process pipeline is ON.
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User [email protected] For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
[INFO] [rclcpp]: signal_handler(signal_value=2)
Global new was called 1913 times during spin
Global delete was called 13349 times during spin
Allocator new was called 38172 times during spin
Allocator delete was called 36238 times during spin

Additional information

The number of allocations varies, but I haven't seen a run where there were fewer calls to global new when using intra process than when not using it.

@sloretz sloretz changed the title [allocator_tutorial] More global allocations used when intra-process is enabled using Fast_RTPS [allocator_tutorial] More global allocations used when intra-process is enabled Dec 11, 2018
@sloretz sloretz added the question Further information is requested label Dec 11, 2018
@sloretz
Copy link
Contributor Author

sloretz commented Dec 11, 2018

Labeled as question because I'm not sure what the correct expected behavior is, but the actual behavior is unexpected to me.

@wjwwood
Copy link
Member

wjwwood commented Dec 20, 2018

I don't know for sure what should be expected here, but I can say that the intra process implementation does do memory allocations depending on what signature of publish is called by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants