Click here to Skip to main content
15,900,511 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I feel so guilty Pin
Mike Hankey22-Dec-21 8:49
mveMike Hankey22-Dec-21 8:49 
GeneralRe: I feel so guilty Pin
honey the codewitch22-Dec-21 9:04
mvahoney the codewitch22-Dec-21 9:04 
GeneralRe: I feel so guilty Pin
Mike Hankey22-Dec-21 9:12
mveMike Hankey22-Dec-21 9:12 
GeneralRe: I feel so guilty Pin
honey the codewitch22-Dec-21 9:33
mvahoney the codewitch22-Dec-21 9:33 
GeneralRe: I feel so guilty Pin
Mike Hankey22-Dec-21 9:51
mveMike Hankey22-Dec-21 9:51 
GeneralRe: I feel so guilty Pin
trønderen22-Dec-21 11:44
trønderen22-Dec-21 11:44 
GeneralRe: I feel so guilty Pin
honey the codewitch22-Dec-21 11:50
mvahoney the codewitch22-Dec-21 11:50 
GeneralRe: I feel so guilty Pin
trønderen22-Dec-21 14:04
trønderen22-Dec-21 14:04 
honey the codewitch wrote:
what I wrote is fundamentally tied to the presence of virtual memory
I'd be happy to learn that connection to virtual memory. I do not immediately see the direct connection between real/virtual memory and heap allocation strategy. Extreme cases may be imagined, as well as in super-fine-tuning, but I have a hard time seeing the connection in the general case - certainly if you claim to be talking about PC applications.
Also you're talking about an unmanaged environment where you can handle your own heap, and you've provided one mechanism for doing it.
A managed system also allocates and frees memory from a pool, even if the freeing is a result of a garbage collection process. A managed system may certainly use buddy allocation for providing managed memory.

Also, if you do not trust the management of managed memory to be as efficient as you would like it to be: Feel free to request a huge block of memory at startup, and then do your own, presumably more efficient, memory allocation from that block.

Actually, that is exactly what I did a few years ago when playing around with buddy allocation mechanisms. The code I used for testing/timing my buddy allocation algorithms was written in C#, rather than assembler/C/C++, but they did confirm my ideas that unless you are completely starved on memory space, buddy allocation is a very efficient allocation strategy from a performance point of view.

Maybe you won't be able to trap memory allocations, e.g. if you have no write access to the source code to make adjustments. It takes some sophistication to go into the dotNet memory manager, modifying it to use a different allocation strategy. I never did. But I never rejected a strategy on the grounds that "dotNet doesn't do it that way, and I don't know how to force it to change its ways".

You may complain about
the hows and whys of the way it's done on PCs now. This isn't about ideal situations, it's about the present situation, if that makes sense.
(Redskin argument: If you don't like it the way it is done in America, go back to where you came from!)

You can handle your own objects. You don't have to point any 'It's his fault!' fingers neither at 'managed memory' nor anything else. If your application needs a well-managed heap, then you allocate a heap, and you manage it well. My theses is that unless you are severely cramped on space in that heap, buddy allocation is one of the most efficient ways to handle that heap of yours.

It might be, even for the underlaying managed memory management system. Probably you won't have any opportunity to affect that. So if your managed memory system is too slow, then you request a memory buffer, and you manage it yourself using better methods.

Your machine may run scores of applications, each of them thinking that they can manage memory better than the common one. So they all allocate huge buffers to do their own administration. Maybe, all things considered, it would have been better relying on the common buffering, with common buffering for all users of the buffer. But maybe you put higher emphasis on 'I did it my way', rather than total system performance.

My position is about the hows and whys of the way it's done on PCs now. This isn't about ideal situations, it's about the present situation, if that makes sense.
If you think alternate buddy allocation strategies are unrelated to "the way it's done on PCs now", because 'that's not how they do it', then you're of course welcome to reject the alternatives, even if they would be better.
GeneralRe: I feel so guilty Pin
honey the codewitch22-Dec-21 14:10
mvahoney the codewitch22-Dec-21 14:10 
GeneralRe: I feel so guilty Pin
trønderen22-Dec-21 15:25
trønderen22-Dec-21 15:25 
GeneralRe: I feel so guilty Pin
OriginalGriff22-Dec-21 8:42
mveOriginalGriff22-Dec-21 8:42 
GeneralRe: I feel so guilty Pin
Mike Hankey22-Dec-21 8:51
mveMike Hankey22-Dec-21 8:51 
NewsRe: I feel so guilty Pin
oofalladeez34322-Dec-21 11:55
professionaloofalladeez34322-Dec-21 11:55 
GeneralRe: I feel so guilty Pin
Marc Clifton22-Dec-21 15:14
mvaMarc Clifton22-Dec-21 15:14 
GeneralRe: I feel so guilty Pin
Mike Hankey22-Dec-21 16:19
mveMike Hankey22-Dec-21 16:19 
GeneralRe: I feel so guilty Pin
Jacquers22-Dec-21 19:07
Jacquers22-Dec-21 19:07 
GeneralRe: I feel so guilty Pin
Mike Hankey23-Dec-21 2:23
mveMike Hankey23-Dec-21 2:23 
GeneralRe: I feel so guilty Pin
Chris C-B22-Dec-21 20:30
Chris C-B22-Dec-21 20:30 
GeneralDas 5QS mechanical keyboard - can recommend Pin
honey the codewitch22-Dec-21 7:40
mvahoney the codewitch22-Dec-21 7:40 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
Mike Hankey22-Dec-21 8:00
mveMike Hankey22-Dec-21 8:00 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
Kris Lantz22-Dec-21 9:04
professionalKris Lantz22-Dec-21 9:04 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
honey the codewitch22-Dec-21 9:08
mvahoney the codewitch22-Dec-21 9:08 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
Roger Wright22-Dec-21 10:25
professionalRoger Wright22-Dec-21 10:25 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
honey the codewitch22-Dec-21 10:29
mvahoney the codewitch22-Dec-21 10:29 
GeneralRe: Das 5QS mechanical keyboard - can recommend Pin
Roger Wright27-Jan-22 15:55
professionalRoger Wright27-Jan-22 15:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   489 votes