EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Serious Memory leak of your samples

Posted: 06/16/2009 00:10:35
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

The sanples you give out have serious memory leak.
For examples you run fileMon.exe ,from "task manager" you will see that
memory useage of your FileMon increase everytime you open a new File,
and never decrease.
Posted: 06/16/2009 02:06:42
by Eugene Mayevski (Team)

The samples are not intended to be full-featured polished applications. They just illustrate the use of the component.

Sincerely yours
Eugene Mayevski
Posted: 06/16/2009 19:08:36
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

Your sample:Filemon is so simple that I do not find any code which may cause
memory leak.So I am afraid that Your cbflt.lib even your filter driver cbflt.sys have memory leak.
Posted: 06/17/2009 01:00:17
by Eugene Mayevski (Team)

Drivers work in context of System process, so it can't be the driver. Most likely it's the string values which are not freed by the application (some APIs return strings which must be freed by the application in C++ API). We will check this.

Also, Task Manager must NOT be used to detect memory leaks. It just lies. You need to use specialized memory leak detection tools for this.

Sincerely yours
Eugene Mayevski
Posted: 06/17/2009 05:51:12
by Vladimir Cherniga (Team)

Please specify the version of FileMon sample(C++, Dephi, .NET).
Posted: 06/17/2009 06:07:56
by Eugene Mayevski (Team)

It's C++ (as .lib file is mentioned).

Sincerely yours
Eugene Mayevski
Posted: 06/17/2009 09:57:03
by Alexander Plas (Team)

Please change AddToLog function according to this
void AddToLog(LPCTSTR Value)
  long lCount = SendMessage(g_hLog, LB_GETCOUNT, 0, 0);
  while (lCount >= 1000)
    SendMessage(g_hLog, LB_DELETESTRING, 0, 0);
  SendMessage(g_hLog, LB_ADDSTRING, 0, (LPARAM)Value);
  SendMessage(g_hLog, LB_SETCURSEL, lCount, 0);

and recheck memory consumption.
Posted: 06/17/2009 18:58:40
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

1)Is c++ version.
2)I would say,AddToLog will not cause memory leak.because I have disable AddToLog
void CbFltOpenFileN(
CallbackFilter* Sender,
LPWSTR FileName,
ACCESS_MASK DesiredAccess,
WORD FileAttributes,
WORD ShareMode,
DWORD CreateOptions)
WCHAR text[MAX_PATH * 2];
wsprintfW(text, L"OpenFileN %s", FileName);

Most likely It is in your .lib
Posted: 06/18/2009 13:25:35
by Vladimir Cherniga (Team)

Make tests with attached driver.

[ Download ]
Posted: 06/18/2009 18:58:37
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

Remain the same.



Topic viewed 19790 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!