Exit code 137 (interrupted by signal 9: SIGKILL)

Hi :slight_smile:

I use manual rendering because I need to take a screenshot after every couple of changes that happen in the scene.

fb_prop = FrameBufferProperties()
fb_prop.setRgbColor(True)
fb_prop.setRgbaBits(8, 8, 8, 0)
fb_prop.setDepthBits(24)
win_prop = WindowProperties.size(frame["width"], frame["height"])

window = base.graphicsEngine.makeOutput(
        base.pipe, "", 0, fb_prop,
        win_prop, GraphicsPipe.BFRefuseWindow
)

disp_region = window.makeDisplayRegion()
disp_region.setCamera(base.cam)
base.graphicsEngine.renderFrame()
scr_s = window.getScreenshot()

problem is that it occasionally stops the process after an arbitrary amount of renders, with exit code 137.
According to the internet it’s a memory issue.

It sometimes happens after graphicsEngine.makeOutput and sometimes after graphicsEngine.renderFrame, so I looked it up and found this:

I added these to the .prc file as recommended

state-cache false
transform-cache false

but it didn’t help.

any ideas?

Which version of Panda3D are you using? On which operating system?

Are you creating a new buffer every time you want to render something? If so, are you deleting the buffer using base.graphicsEngine.removeWindow(window) ?

I am using Panda3D version 1.10.11

Yes I am creating a new buffer for every render,

And no I am not, didn’t occur to me :sweat_smile:
I was counting on some pythonic blood magic (or garbage collector)

I’ll try that

EDIT
It worked! thank you

@rdb

I added base.graphicsEngine.removeWindow(window) at the end of my screenshot function but I’m still getting an error for some reason at base.graphicsEngine.renderFrame():

:linmath(warning): Tried to invert singular LMatrix4.
Assertion failed: has_mat() at line 461 of built1.10/include/transformState.I
AssertionError: has_mat() at line 461 of built1.10/include/transformState.I

For the record, I don’t have anything with scale 0 (saw this issue somewhere on this forum)

Could you perhaps have something that is altering the scale of an object, and that might perhaps alter it to zero? (For example, an element that causes an object to smoothly scale down over time.)

Alternatively, do you perhaps have any code that takes a scale as a parameter, and that might possibly be being passed a value of zero?

I’ve had both of those, as I recall.