Re: Memory leak in the Driver



Hi Mr. Sameer Moidu,
Thank You for your support, i'd try doing that, but the name sounds
like it is for application, will it also work for device driver ???
anyway i'll read the document and try that.
and thank you for the tutorials, that will definitely will be edge to
me.
Thanks and Regards,
Neo

On Jan 20, 5:45 am, "Sameer Moidu \(MS\)" <smo...@xxxxxxxxxxxxx>
wrote:
Another tool you might use is Application Verifier, shipped as part of the
CETK for CE and Windows Mobile.

A good tutorial is onhttp://msdn.microsoft.com/embedded/usewinemb/ce/techno/testtools/defa...
as well as onhttp://msdn.microsoft.com/embedded/getstart/basics/tutorialsce/defaul....

App verifier questions can also be directed to
microsoft.public.windowsce.testtools.

"Neo" <rksandi...@xxxxxxxxx> wrote in message

news:1169225193.489811.15520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



Hi, Paul Tobey,

Yes, my application is closing everything properly, in fact my
application has only four lines of code and it is console based
application.

my application is as follows,

while(loop) {
CreateFile
WriteFile\ReadFile
CloseHandle
}
if this application is used then there is a memory leak.
otherwise
if the following application is used then, there is no memory leak.

CreateFile
while(loop){
WriteFile\ReadFile
}
CloseHandle

My Device is an USB-Serial Device, but not storage device. i am trying
to open the COM Ports using CreateFile and trying to send some data,
read and write and then CloseHandle in the application.

i see any application on WinCE desktop if opened and closed shoots up
the memory and later subsides down,but before the memory subsides if we
try to open,close again and again then the shooted memory will never
comes down.

Thanks Paul for the help.

Thanks and Regards,
Neo

Paul G. Tobey [eMVP] wrote:
I suppose it might be a valid problem description. Are you sure that
your
application code is actually closing everything? I've never observed
such a
leak in any of my devices. How does this "device" relate to the hardware
you are building a driver for? You're writing a driver for some sort of
storage device where these files that are getting opened and closed over
and
over again are located? It's files that are being opened or the device
itself via CreateFile( _T( "DEV3:" ), ...) or something similar?

Paul T.

"Neo" <rksandi...@xxxxxxxxx> wrote in message
news:1169215588.397188.188920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Mr. Paul Tobey,

i have some observations from my side and need some help.

when i open and close any application\file or folder in WinCE
continuosly for more than 2 times(Fastly), then the WinCE eats up
memory.

This is the cause for my problem.

My application does the folowing,
opens the device,
writes data to the device and then
closes the device multiple times in a loop.

if i do like the way mentioned below,
open the device,
write the data multiple times in a loop
close the device,
then there is no memory leak.

My Question is,
Opening and Closing any file\folder\application in WinCE continuosly
eats memory.
Is this Observation Valid ???

plz forgive in case if it is invalid observation.

Thanks and Regards,
Neo

Neo wrote:
Hi Mr. Paul,
Thanks for that info !!!

i'll try to resolve with the info and suggestions u've provided !!!
sorry if i was emotional yesterday !!!

Thanks and Regards,
Neo

Paul G. Tobey [eMVP] wrote:
I understand that management can be stupid about spending cash on
something
as opposed to time, which is a lot more expensive, but harder to
keep
track
of. I try not to do that to the guys on my team.

OK, so you're left with trying to figure it out yourself. Turn on
all
of
the debug messages for USB. You may need to read the help on "debug
zones"
to accomplish that. Capture everything that happens and keep good
records
of what you did, how much memory was leaked and what the debug
messages
were. Repeat until you figure it out...

Don't forget that "handles" are memory, too, as are USB packets,
data
buffers, etc. Anything that is allocated, whether you are
allocating
it and
someone else is supposed to free it or, maybe, someone else is
allocating it
and *you* are supposed to free it, could be the source of the leak.
In
every case that you find, assume that *you* are doing something
wrong,
because that's the highest probability. Maybe Microsoft has a bug,
but
the
chances that *you* have the bug are MUCH, MUCH higher.

Paul T.

"Neo" <rksandi...@xxxxxxxxx> wrote in message
news:1169143515.813673.79070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Mr.Paul,

i have tried things which are in my reach,
and regarding buying the tools,
it is not in my hands as my top management has to take a decision
on
it
!!!!

actually, i cannot do either i.e., buying or hiring !!!
it's a task given to me so, probably i'll be trying myself or i'll
quit
this task !!!
i am new to Windows CE Driver Devlopment and i am unable to
complete
my
task.

anyway thank you and thanks all for giving hints and suggestions
!!!
sorry for disturbing you all and sorry for the trouble !!!

tell me what more info i can provide to you so that you can help
me
??
and if it's not possible then i am sorry for giving you the
trouble.

Thanks and Regards,
Neo

Paul G. Tobey [eMVP] wrote:
We are not going to be able to help you remotely. Given that you
are new
to
driver development, it's most likely that you are at fault.
Since
we've
given you a list of things that you can try and you've either
tried
them
and
failed or been unwilling or unable to try them, the rest is going
to
be
up
to you. You're either going to have to buy some useful tools to
help
with
this, learn enough on your own by trying things, or hire someone
who
can
actually take your code and your hardware and try to find the
problem.

Paul T.

"Neo" <rksandi...@xxxxxxxxx> wrote in message
news:1169123630.033007.67860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,

The QFE has no impact on the leak but one thing is sure, there
is
memory leak when i issue a bulk transfer request using
"lpIssueBulkTransfer" this seems to be troubling me !!!
help neeeded ASAP

Thanks and Regards,
Neo

Neo wrote:
Hi Mr. Paul,

i understand your words and i feel pity about myself and my
helpless
condition.
anyway i had already put prints when i am allocating and
deallocating,
i am sure that all the memory that i am allocating in my
driver
is
released.

i see problem with one of this call "lpIssueBulkTransfer", if
i
comment this in my code then the amount of memory leak
drastically
comes down, i do not understand the mystery behind this !!!
help needed regarding this !!!

and Also thank you for mentioning about QFE, which i am
unaware
of, i
will try that and let the group know the result.

Thank you alll for the help !!!

Thanks and Regards,
Neo

Paul G. Tobey [eMVP] wrote:
Have you applied all of the Platform Builder QFEs?

Paul T.

"Neo" <rksandi...@xxxxxxxxx> wrote in message
news:1169060894.231009.199230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Also i want to know whether there are any known leaks in
the
platform
builder 5.0(WinCE5.0) Edition.
i am developing USB-Serial Driver which uses both USB
related
functions
and also the Serial related Code.
are there any known memory leaks in other dll's which will
used in
usb-serial driver development.

Thanks and Regards,
Neo

Neo wrote:
Hi Mr.Chris Tacke

As of now i cannot get that tool in for me.
Anyway it is since a week i was trying to find this leak
!!!!
i can understand what u said and it's right too !!!

but i need to go thru the normal way of debugging and i
am
limited
by
my resources !!!
hoping for more support from you guys !!!

Thanks and Regards,
Neo

<ctacke/> wrote:
Platform Builder wasn't free either, yet you're

...

read more »- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: Memory leak in the Driver
    ... anyway i had already put prints when i am allocating and deallocating, ... i am sure that all the memory that i am allocating in my driver is ... i am developing USB-Serial Driver which uses both USB related functions ... Anyway it is since a week i was trying to find this leak!!!! ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Memory leak in the Driver
    ... Don't forget that "handles" are memory, too, as are USB packets, data ... someone else is supposed to free it or, maybe, someone else is allocating it ... and *you* are supposed to free it, could be the source of the leak. ... driver development, it's most likely that you are at fault. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: get_user_pages fails for contiguous memory?
    ... I trying run/test a simple use case where, I am allocating buffers in one driver using get_free_pages, map them to user application and pass it to another driver for processing. ... I would like to use this buffer in resizer driver, which resizes the image depending on user configuration. ... If I allocate a memory using malloc or memalign from in user space and pass it to resizer driver it works fine. ...
    (Linux-Kernel)
  • Re: Nonpaged pool exhausted
    ... I'd read KB 272568 and after it I'd deleted symantec ... There are no symevent driver on my system now (I've checked it ... I've already looked at memory usage in task manager. ... The memory leak can be identified by using one of the two following ...
    (microsoft.public.windows.server.general)
  • Re: Memory leak in the Driver
    ... then there is no memory leak. ... someone else is supposed to free it or, maybe, someone else is allocating it ... and *you* are supposed to free it, could be the source of the leak. ... driver development, it's most likely that you are at fault. ...
    (microsoft.public.windowsce.platbuilder)