Comment 23 for bug 1495871

Revision history for this message
Albert Astals Cid (aacid) wrote :

I've found two ways (which are effectively the same) to workaround the fd leak caused by killing an app (comment #18)
 * removing surfaceItem.surface = null; in unity8 SurfaceContainer.qml
 * removing the 3 deleteLater in qtmir session.cpp

Both have the same effect. qtmir's session and mirsurface won't be freed when the application is killed, just when the user actually swipes down from the side spread, by doing that the fd leak is gone.

It has two problems:
 * We are delaying freeing memory resources and since the most common occurrence of apps being killed is by the OOM, this is not good
 * If you try to restart the app without swiping down from the side spread, unity8 will crash because the mir surface item has bad data, i think this could be fixed, but the first problem seems strong enough to disqualify these solutions.

The workaround seem to imply that something is wrong when the early free for killed apps is done.

I've read the code and to my non-domain-expert-eye it all seems good.

Valgrind could not find any memory or fd leak either.

Maybe someone from the mir/qtmir fields can have a look at the early free code for killed apps and see if they see anything wrong?