Memory leak strategies?

Here is the terrainexe zipped, hopefully the forum lets it through. Mine in 32 bit starts out at like 175MB then drops to 145MB then starts marching up the memory at 0.6MB/sec.
terrainexe.zip (15.6 MB)
My card is a radeon rx570, it has been a while since I’ve updated its drivers, so will do that.
Compiled and run from the CGE editor, it still eats the memory, but only at 0.3MB/sec compared to running from Lazarus.

Oh, I’ve got RX560, so we’re very close. My drivers aren’t up to date, but not too old. I guess I updated them somewhere last year.

I am SO happy to report that updating the radeon driver to the latest (which is from jan23) has solved the memory leak in terrain example and my program!!

1 Like

Ha! Hooray! OK, so this was a memory leak in OpenGL implementation indeed.

P.S. If you’d like to display to users something like “you seem to have Radeon drivers but too old, please upgrade” you can use properties of singleton GLVersion for this. See the GLInformationString output that summarizes various values from GLVersion. E.g. you can something like

if (GLVersion.VendorType = gvArm) and 
   (GLVersion.VendorMajor < 10) then
  MessageOK('You hav ARM GPU with too old drivers, please upgrade your drivers.');

You can do it essentially anywhere – e.g. at Start of first view.

2 Likes

I put that in… for this it is gvAti and VendorMajor < 24 as I imagine overlaying a mini view of a scene on the main view of the scene is common need.