There are some bugs that sometimes remain with the operating system until the developer team they find the solution to correct it. That until they "find" the solution usually takes a few weeks, a few months or, in some cases, even years. We can look at Android 5.1 as the "memory leak" bug was finally fixed, but he has encountered something similar again in Marshmallow.
According to Google's event log, the system "Memory leak" problem in Marshmallow, numbered 195104, has been closed with the status "future release". This probably means that in Android N or in those monthly security patches, we can already have that correction that will mean an increase in performance for this version of Android that frankly works very well.
There are a good variety of problems that concern the system memory, but this one, numbered 195104, had 500 stars and has been active since last year, so it is one of the important ones that tarnishes the performance of the system. If this "memory leak" is damaging to the system, it is that it is one of the reasons why the system consumes more RAM for a longer time when the device is on, which definitely led to instability and some inopportune shutdown in the background.
This means that the system not working properly and both performance and battery consumption suffer, since it also ensures that the process that has had to be closed is reopened with the possibility that, again, it is blocked.
We have no doubt that software development is something quite complicated and that, for some of the most unsuspected problems, sometimes it requires the invaluable help of some fortuitous event to clear things up and turn on that light bulb to the team in charge of filing down rough edges.