← Back to team overview

kicad-developers team mailing list archive

Re: Make Cairo optional

 

Le 29/03/2016 13:54, Chris Pavlina a écrit :
> On Tue, Mar 29, 2016 at 09:46:25AM +0200, jp charras wrote:
>> [[snip]]
>> But the main reason is the fact on Opengl I am easily out of memory with large boards, with 4Go of
>> RAM (W7 32 bits).
>> I am thinking this is due to memory fragmentation.
>>
>> I am afraid we have more easily this issue if Eeschema + Pcbnew + other frames use OpenGL.
>>
>> Cairo do not have this issue.
>> [[snip]]
> 
> Perhaps there is some memory leak or similar issue in the OpenGL GAL code that
> should be fixed, rather than just avoiding it?
> 

It is not a memory leak.

Currently, very large chunks of memory are frequently allocated and deallocated (256 to 512 Mbytes)
for large boards by the current code.

When you are working on such boards, and after editing, running DRC ot 3D viewer, you can be out of
memory (when the memory is fragmented a lot) to reallocate a block of 256 to 512 Mbytes in RAM, even
with 4 Gb)
Remember when closing eeschema, or the 3D viewer or any other main frame, the memory is not free-ed.
Only frames are closed, but a lot of data is kept in memory.

Of course, if some other application (for instance Mozilla Firefox, a frequent case) is open, it
happens more easily.

To fix it, the algorithm which allocate and deallocate the RAM must be redesigned and/or optimized.
(see cached_container.cpp), but this is not so easy.
(In cached_container.cpp, a compil option is added to reduce the frequency of allocations and
deallocations, and it seriously helps but does not fix all issues)


Besides, Some Graphic cards have bugs in OpenGL mode (see https://bugs.launchpad.net/bugs/1561928
for instance).

Having said that, I am sure there is some memory leak at least in the 3D viewer.


-- 
Jean-Pierre CHARRAS


Follow ups

References