OSCsend fills up memory and the app gets killed by RaspbianOS


I have an app than runs on Raspberry Pi and Mac. It sends quite a few OSC messages every frame with 60fps. After many hours the app is killed by the RaspbianOS for using too much memory and virtual memory. When I try the app on Mac I can see the memory used goes up quite fast. Is this normal, or is it a bug? Is there some way to empty/deallocate the memory while the app is running?

I’ve built apps that send quite a few OSC messages every frame at 60fps, from Mac to oF on iOS and haven’t hit that issue. Have you got some code you could share to help us understand what’s happening?

This function runs in the ofApp::update(), and the size of myCircle.size() is 24:

void ofApp::osc() {

    ofxOscMessage m;

    m.setAddress( "/harmo" );
    for ( int i = 0; i < myCircle.size(); i++ ) {
        m.addFloatArg( ofMap( myCircle[i].pos.x, 0, ofGetWidth(), -1, 1 ) );
        m.addFloatArg( ofMap( myCircle[i].pos.y, 0, ofGetHeight(), -1, 1 ) );
        m.addFloatArg( myCircle[i].hueAngle );
    m.addFloatArg( myCircle[0].circleResolution );
    sender.sendMessage( m, false );