8525 views|21 replies

68

Posts

0

Resources
The OP

Wince memory leak problem [Copy link]

The project requires the use of an RFID card reader under wince. This program queries every 200 milliseconds whether an RFID card is swiped (initiates an invitation). Now, there is a memory leak during the execution of the program. It is very regular. It can be located that a certain line of code that queries whether an RFID card is swiped causes the leak. This line of code is a call to an SDK function. Since I have the source code of the SDK function, I found that this function should not cause a memory leak. Now I wonder if the memory leak is caused by the RFID card reader driver? PS: The leaked memory can be recovered when the program exits, but once the program is re-executed, the system's memory usage increases a lot, exceeding the value before the previous execution and shutdown. —— I don't know if this can be confirmed as a driver memory leak?

This post is from Embedded System

Latest reply

mark  Details Published on 2010-1-21 13:59

68

Posts

0

Resources
2
Fatigue test to see if there is memory failure and the application cannot run normally. The memory recycling mechanism of CE is a little different from that of PC. I guess it is just memory fragmentation.
This post is from Embedded System

71

Posts

0

Resources
3
After the program runs for a long time, it will prompt that the system memory is seriously insufficient.
This post is from Embedded System

79

Posts

0

Resources
4
It should be caused by virtual memory not being released----------------------------- You can call the API to query the size of the available virtual memory in the current slot to determine the problem. I have encountered similar problems before, and this is how I determined it----------------------------- You can check the API online. If you can't find it, I will find it for you this afternoon.
This post is from Embedded System

83

Posts

0

Resources
5
But once the program was restarted, the system's memory usage suddenly increased a lot, exceeding the value before the program was shut down. --------I remember that this was not accurate. It took him a while to react.

This post is from Embedded System

62

Posts

0

Resources
6
Thank you for your warm-hearted friend. If the virtual memory is not released, how can I solve it?
Quote the reply of guopeixin on the 3rd floor: It should be caused by the virtual memory not being released. You can call the API to query the size of the available virtual memory in the current slot to determine the problem. I have encountered similar problems before, and this is how I determined it. You can check the API online. If you can't find it, I will find it for you this afternoon.
This post is from Embedded System

73

Posts

0

Resources
7
Does it take a long time? It took me a while, but it still didn't work.
Quote from the reply of mxm1986 on the 4th floor: But once the program is re-executed, the system's memory usage suddenly increases a lot, exceeding the value before the previous execution and shutdown. --------I remember that this is not accurate. . It will take him a while to react.
This post is from Embedded System

90

Posts

0

Resources
8
Isn't virtual memory automatically released by the system?
This post is from Embedded System

73

Posts

0

Resources
9
Quote from m_jy163 on the 5th floor: You are such a caring friend, thank you. If the virtual memory is really not released, how can we solve it? Quote from guopeixin on the 3rd floor: It should be caused by the virtual memory not being released----------------------------- You can call the API to query the size of the available virtual memory in the current slot to determine the problem. I have encountered similar problems before, and this is how I determined it----------------------------- You can check the API online. If you can't find it, I will find it for you this afternoon.
It happened in the 5.0 project before. Because each slot has 32mb of space, we will cause 64kb of space to be lost at a time. After many operations on the upper-level AP, the current slot space will be used out. Just release it.
This post is from Embedded System

68

Posts

0

Resources
10
Make a mark
This post is from Embedded System

78

Posts

0

Resources
11
How to release it? Haha. I am a novice, I hope you can give me some advice.
Quote the reply from guopeixin on the 8th floor: Quote the reply from m_jy163 on the 5th floor: You are a really enthusiastic friend, thank you. If the virtual memory is really not released, how to solve it? Quote the reply from guopeixin on the 3rd floor: It should be caused by the virtual memory not being released----------------------------- You can call the API to query the size of the available virtual memory in the current slot to determine the problem. I have encountered similar problems before, and this is how I determined it----------------------------- You can check the API online. If you can't find it, I will find it for you in the afternoon. It appeared in the 5.0 project before. Because each slot is 32mb of space, we will cause 64kb of space to be lost at a time. After many operations on the upper-level AP, the current slot space will be used out. Just release it.
This post is from Embedded System

75

Posts

0

Resources
12
Will memory leaks cause system crashes? My board crashes and the screen remains frozen, but dnw does not show any debugging information
This post is from Embedded System

55

Posts

0

Resources
13
Quote from m_jy163 on the 10th floor: How to release it? Haha. I am a novice, so I hope you can give me some advice. Quote from guopeixin on the 8th floor: Quote from m_jy163 on the 5th floor: You are such a caring friend, thank you. If it is really the virtual memory that has not been released, how can we solve it? Quote from guopeixin on the 3rd floor: It should be caused by the virtual memory not being released----------------------------- You can call the API to query the size of the available virtual memory in the current slot to determine the problem. I have encountered similar problems before, and that is how I determined it----------------------------- You can check the API online to change it. If you can't find it, I will find it for you in the 5.0 project this afternoon. Because each slot is 32mb of space, we will cause the loss of 64kb of space at a time. After many operations on the upper-level AP, the current slot space will be used out. Just release it.
First find the location of the leak and release it directly.
This post is from Embedded System

72

Posts

0

Resources
14
UP
This post is from Embedded System

80

Posts

0

Resources
15
Quote from the reply of the original poster m_jy163: The project requires the use of an RFID card reader under WinCE. This program queries every 200 milliseconds whether an RFID card is swiped (initiates an invitation). Now, there is a memory leak during the execution of the program. It is very regular. It can be located that a certain line of code that queries whether an RFID card is swiped causes the leak. This line of code is a call to an SDK function. Since I have the source code of the SDK function, I found that this function should not cause a memory leak. Now I suspect that the memory leak is caused by the RFID card reader driver? PS: The leaked memory can be recovered when the program exits, but once the program is re-executed, the system's memory usage increases a lot, exceeding the value before the previous execution and shutdown. - I don't know if this can be confirmed as a driver memory leak?
Is there a buffer clearing operation function in the driver? If so, call it, or initialize the call parameters before the function to see if the memory will increase. Of course, this is to test whether the memory is generated by the input parameters.
This post is from Embedded System

64

Posts

0

Resources
16
http://topic.eeworld.net/u/20091111/16/8f1cde89-22c6-467e-a11e-8d2e5f020885.html?68418 You will find the result if you follow this post. You can also google it yourself. How to release the memory applied for, for example, after new, it will be followed by delete, so there should be a one-to-one correspondence.
This post is from Embedded System

76

Posts

0

Resources
17
Quote from stoneqiang's reply on the 15th floor: http://topic.eeworld.net/u/20091111/16/8f1cde89-22c6-467e-a11e-8d2e5f020885.html?68418 You will find the result if you follow this post. You can also google it yourself. How to release the memory applied for, for example, after new, it will be followed by delete, one by one
I like this~~~ Hehe
This post is from Embedded System

76

Posts

0

Resources
18
When the program runs for a long time, try to reduce dynamic allocation. Even if you release it after allocation, it will still be the same.
This post is from Embedded System

66

Posts

0

Resources
19
Help
This post is from Embedded System

82

Posts

0

Resources
20
Using CodeSnitch
This post is from Embedded System

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list