1

Topic: Storage selection under the data std:: vector. What nuances?

I correctly understand, at storage selection under the data std:: vector the linear segment that is why even if the operating system shows sufficient for layout of the data of this vector storage is required, it does not mean, what the vector can be created (type, the heap is defragmented)? And if yes, that is whether any standards on the manager of a heap (well there that it always reorders accessible storage so that the free represented one linear segment, etc.). To me it is simple to understand, why can happen  bad_alloc at visible in the manager of tasks presence of free the RAM. For example, here to me sent the schedule of loading of storage by operation of my program before embarkation bad_alloc on the moment when it should request the storage equal to storage of that ate at present (like, on a picture, the place still was):

2

Re: Storage selection under the data std:: vector. What nuances?

Hello, _hum _, you wrote: __> I correctly understand, at storage selection under the data std:: vector the linear segment that is why even if the operating system shows sufficient for layout of the data of this vector storage is required, it does not mean, what the vector can be created (type, the heap is defragmented)? Yes. __> and if yes, that is whether any standards on the manager of a heap (well there that it always reorders accessible storage so that the free represented one linear segment, etc.) . It cannot reorder anything, on selected already pointers are got, which the manager of a heap does not supervise. It to you not  in a toad. If it is necessary to be pressed in pieces, it is possible to try other containers, an extremal variant - the list, when on everyone  the selection. But here can lose strongly, if elements small. Or a deque, it like just pieces would select. __> to me it is simple to understand, why can happen  bad_alloc at visible in the manager of tasks presence of free the RAM. For example, here to me sent the schedule of loading of storage by operation of my program before embarkation bad_alloc on the moment when it should request the storage equal to storage of that ate at present (like, on a picture, the place still was): Standardly, for normal operation of the manager of storage the minimum of twice more storage is required, than will be as much as possible selected. And it is better - in four. Or get to itself at once all big that is required by operation, it is better one piece that with perversions of type ASLR not to face.

3

Re: Storage selection under the data std:: vector. What nuances?

Hello, _hum _, you wrote: __> And if yes, that is whether any standards on the manager of a heap (well there that it always reorders accessible storage so that the free represented one linear segment, etc.) . Adjacent free pieces merge practically in any manager of a heap. And to merge not adjacent, it is necessary to be able occupied to move, and how it you will make in a C ++ if links to them can hide, anywhere? __> to me it is simple to understand, why can happen  bad_alloc at visible in the manager of tasks presence of free the RAM. For example, here to me sent the schedule of loading of storage by operation of my program before embarkation bad_alloc on the moment when it should request the storage equal to storage of that ate at present (like, on a picture, the place still was): Well, for example, attempt  hardly works terabyte. Such can happen at incorrect count of an amount  storages (in the program, instead of in standard library).

4

Re: Storage selection under the data std:: vector. What nuances?

Hello, _hum _, you wrote: __> I correctly understand, at storage selection under the data std:: vector the linear segment that is why even if the operating system shows sufficient for layout of the data of this vector storage is required, it does not mean, what the vector can be created (type, the heap is defragmented)? __> And if yes, that is whether any standards on the manager of a heap (well there that it always reorders accessible storage so that the free represented one linear segment, etc.). __> To me it is simple to understand, why can happen  bad_alloc at visible in the manager of tasks presence of free the RAM. For example, here to me sent the schedule of loading of storage by operation of my program before embarkation bad_alloc on the moment when it should request the storage equal to storage of that ate at present (like, on a picture, the place still was): __> Image: c088a83ef536.jpg Start of 32 bit processes in a 64-bit surrounding?

5

Re: Storage selection under the data std:: vector. What nuances?

Hello, SaZ, you wrote: SaZ> Start of 32 bit processes in a 64-bit surrounding? Probably. Thanks for idea.

6

Re: Storage selection under the data std:: vector. What nuances?

Hello, Pzz, you wrote: Pzz> Hello, _hum _, you wrote: __>> And if yes, that is whether any standards on the manager of a heap (well there that it always reorders accessible storage so that the free represented one linear segment, etc.). Pzz> Adjacent free pieces merge practically in any manager of a heap. And to merge not adjacent, it is necessary to be able occupied to move, and how it you will make in a C ++ if links to them can hide, anywhere? And what for a problem from a C ++ on Windows? Pointers after all on virtual storage, therefore the manager of a heap can release not used page or a little in "hole", and OS  this unengaged piece somewhere else.

7

Re: Storage selection under the data std:: vector. What nuances?

Hello, Zhendos, you wrote: Z> And what for a problem from a C ++ on Windows? Pointers after all on virtual storage, Z> therefore the manager of a heap can release not used page or a little in "hole", Z> and OS  this unengaged piece somewhere else. It still is necessary, that at you the whole page was free. But basically, the modern managers of a heap are able, speak, to return storage to system.