This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory leak in JFFS2 unmount


Øyvind Harboe wrote:

Shouldn't the call to

free(fd)

be

jffs2_free_full_dirent(fd) ?



Sounds like you are onto something.


Could you share your findings that preceded your post?




The memory to be freed is allocated with jffs2_alloc_full_dirent.

The reason that we want the call to be to jffs2_free_full_dirent is that we are using pooled memory instead of dynamic allocation.
The current system we are developing in is a bit sensitive when it comes to memory fragmentation, so we have extended the pooled memory concept a bit, as of now the code needs a lot of tidying up before it can be a subject for this list.


In our system the free(fd) caused a bit of havoc due to our pools which all are accessed from the jffs2_alloc_full_dirent & jffs2_free_full_dirent methods.
Thinking that the jffs2_free_full_dirent is an ecos jffs2 method (which doesn't do much from the beginning) it should still be called in case of further development. (And it also helps us with keeping our repository up do date with the anoncvs version, as a bonus).



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]