examples: enable Python memory profiling (#5421)