Memory leak with b0-based simxGetVisionSensorImage

Report crashes, strange behaviour, or apparent bugs
Post Reply
pbustos
Posts: 4
Joined: 22 Dec 2019, 14:56

Memory leak with b0-based simxGetVisionSensorImage

Post by pbustos »

Hello,

I have a simple Python script that read images from a scene's camera:

import vrep, b0RemoteApi

client = b0RemoteApi.RemoteApiClient('b0RemoteApi_pythonClient','b0RemoteApiAddOn')
wall_camera = client.simxGetObjectHandle('camera_1_rgb', client.simxServiceCall())

while True:
a,resolution,image = client.simxGetVisionSensorImage(wall_camera[1], False, client.simxServiceCall())
d = client.simxGetVisionSensorDepthBuffer(wall_camera[1],True, True, client.simxServiceCall())

that continually increases its memory footprint in the system

The scene has a Vision Sensor in it.

Am I doing something wrong?

Thanks

coppelia
Site Admin
Posts: 7911
Joined: 14 Dec 2012, 00:25

Re: Memory leak with b0-based simxGetVisionSensorImage

Post by coppelia »

Hello,

I think you found a bug... can you add:

Code: Select all

        b0_buffer_delete(outbuf)
just before the function return in function Subscriber:read, near line 202, and in function ServiceClient:call, near line 235, in file b0.py?

Let me know if that solves your memory usage problem.

Cheers

pbustos
Posts: 4
Joined: 22 Dec 2019, 14:56

Re: Memory leak with b0-based simxGetVisionSensorImage

Post by pbustos »

Thank you very much,

it works fantastic now, no memory leaks.

Pablo

Post Reply