SYSTEM AND METHOD FOR MONITORING MEMORY STACK SIZE
First Claim
1. A method for monitoring a memory stack size, the method comprising:
- initializing, by a controller, all stack regions of a memory stack;
dividing, by the controller, all the stack regions of the memory stack into n blocks;
checking, by the controller, a block sampling first section that is sampled among the stack regions of each block, using a first pointer and a second pointer that each designate memory address positions in order to determine whether the memory stack is used from a first block to an n-th block among the n blocks;
determining, by the controller, whether a usage trace is present in the block sampling section;
in response to determining that a usage trace is present in the block sampling first section from the first block to the last, n-th block, determining, by the controller, that a stack overflow phenomenon is able to occur and if so, executing fail-safe logic; and
in response to determining that no usage trace is present in one among first through last, (n−
1)-th blocks, measuring a size of the memory stack.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method for monitoring a memory stack size is provided, and more particularly, a method for monitoring a memory stack size, whereby the size of a memory stack applied to an operating system of a controller for a vehicle is monitored so that an overflow phenomenon of the memory stack can be prevented. That is, an accurate usage amount of a memory stack of the entire control system for a hybrid vehicle is efficiently and effectively monitored so that, when the control system reaches a risk level of stack overflow, fail-safe logic is executed and an overflow phenomenon of the memory stack as a result can be prevented.
-
Citations
14 Claims
-
1. A method for monitoring a memory stack size, the method comprising:
-
initializing, by a controller, all stack regions of a memory stack; dividing, by the controller, all the stack regions of the memory stack into n blocks; checking, by the controller, a block sampling first section that is sampled among the stack regions of each block, using a first pointer and a second pointer that each designate memory address positions in order to determine whether the memory stack is used from a first block to an n-th block among the n blocks; determining, by the controller, whether a usage trace is present in the block sampling section; in response to determining that a usage trace is present in the block sampling first section from the first block to the last, n-th block, determining, by the controller, that a stack overflow phenomenon is able to occur and if so, executing fail-safe logic; and in response to determining that no usage trace is present in one among first through last, (n−
1)-th blocks, measuring a size of the memory stack. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer readable medium containing program instructions executed by a controller for monitoring a memory stack size, the computer readable medium comprising:
-
program instructions that initialize all stack regions of a memory stack; program instructions that divide all the stack regions of the memory stack into n blocks; program instructions that check a block sampling first section that is sampled among the stack regions of each block, using a first pointer and a second pointer that each designate memory address positions in order to determine whether the memory stack is used from a first block to an n-th block among the n blocks; program instructions that determine whether a usage trace is present in the block sampling section; program instructions that determine that a stack overflow phenomenon is able to occur and if so, executing fail-safe logic in response determining that a usage trace is present in the block sampling first section from the first block to the last, n-th block; and program instructions that measure a size of the memory stack in response to determining that no usage trace is present in one among first through last, (n−
1)-th blocks. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A controller for monitoring a memory stack size in a vehicle, the controller comprising:
-
a memory configured to store a plurality of program instructions; and a processor configured to execute the plurality of program instructions, the program instructions operable to; initialize all stack regions of a memory stack; divide all the stack regions of the memory stack into n blocks; check a block sampling first section that is sampled among the stack regions of each block, using a first pointer and a second pointer that each designate memory address positions in order to determine whether the memory stack is used from a first block to an n-th block among the n blocks; determine whether a usage trace is present in the block sampling section; determine that a stack overflow phenomenon is able to occur and if so, executing fail-safe logic in response determining that a usage trace is present in the block sampling first section from the first block to the last, n-th block; and measure a size of the memory stack in response to determining that no usage trace is present in one among first through last, (n−
1)-th blocks.
-
Specification