You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
when closing a handle, isn't the memory (which has been allocated over and above that specified in CreateFileMapping) not reverted back?
at the end of what? the end of the win dow or the closing of a handful or the closing of an application?
It is somehow wrong to free memory while running by closing the descriptor.
The memory should be freed without the hope of Windos.
:) how else could it be freed? everything you've allocated, you've deleted. MSDN for Mapping does not say anything about manually freeing memory before closing the handler
Vadim, what exactly are we parsing?
I found two ways to expand the memory. Do you think there will be problems with memory leaks in both cases?
If all descriptors are closed, there are no leaks. Leakage is when a program is unloaded but leaves resources occupied.
But there may be problems with excessive memory consumption. I had such problems myself not so long ago. I connected wrong class for working with timeseries. I added a class that indexes ticks by seconds. Started using this class to work with monthly bars. It ate all the memory in 30 seconds. This is one of the possible variants. We should monitor this kind of things and warn about them.
The second case is when the program needs a lot of memory, for instance, 1000 Mb, but not for a long time. If you don't free it, the other programs will have 1000 MB less until your program is unloaded.
In short, you need to keep track of resource consumption.