CARVIEW |
Select Language
HTTP/2 200
date: Mon, 28 Jul 2025 20:01:14 GMT
content-type: text/html; charset=utf-8
cf-ray: 9666f79a3cbce8e0-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=7f1b9c2f-12ba-4195-b7d7-c9398d750c0e; expires=Tue, 28 Jul 2026 20:01:13 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: f526a16f-f1a5-4308-a769-853d97f2d67b
x-worker-origin-response-time: 1023000000
x-dns-prefetch-control: off
set-cookie: prov=7f1b9c2f-12ba-4195-b7d7-c9398d750c0e; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=EJEAbO7R0hA2GVYlnO4xoq2ju6hL3qeVDtZdzwK8fV0-1753732874-1.0.1.1-7WUnd6g9xzA0suw8DcgZYT09ePLodpUDJPC7tytuuMyW9ij1b7mXDcJMdaFhQo4.st.tCL302YXYqvQPX9rU5_fGl7mIDUQ8kAW_8en8Drk; path=/; expires=Mon, 28-Jul-25 20:31:14 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=idk7oMGphKmdMshRMZkPc3G2oPSJJVQeCMmT0xCZ.qA-1753732874356-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'memory-management' Questions - Code Review Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [memory-management]
Memory management is the act of managing computer memory by allocating portions of memory to programs as well as freeing memory so that it can be re-used.
648 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
10
votes
6
answers
2k
views
k-Nearest Neighbors algorithm in C
I've been learning C for a while, and I decided to make a simple kNN program. What can I do to improve the program?
Am I doing memory management right? Can the structure of the code be improved in ...
1
vote
0
answers
74
views
MemoryGraveyardDriver.sys - a kernel mode device driver managing a kilobyte of RAM for random reading/writing: Take II
(See the previous and initial iteration.)
This time I have incorporated some improvement points made by G. Sliepen:
driver.cpp:
...
8
votes
1
answer
513
views
MemoryGraveyardDriver.sys - a kernel mode device driver managing a kilobyte of RAM for random reading/writing
(See the second and next iteration.)
Intro
I have this GitHub repository. Basically, it does not do anything fancy: it has a byte buffer of 1Kb size, and it intercepts ...
4
votes
2
answers
195
views
C++ wrapper for FreeRTOS blocking queue that can handle complex objects
The FreeRTOS queue is a convenient way for intertask communication on FreeRTOS. But it is written in pain C and therefore it feels a little uncomfortable for C++ programmers. But the main problem is, ...
0
votes
1
answer
90
views
Implementing safe custom exception [closed]
I was trying to come up with some design to subclass built-in exceptions.
For simplest case I used something like this:
...
4
votes
2
answers
249
views
SPSC templatized lock free queue implementation and benchmarking
I have tried implemented a fast lock free Single producer single consumer queue in C++ for practicing concurrency and low level design concepts. I also benchmarked the code on x86_64 2.3GHz Intel ...
4
votes
2
answers
416
views
Arena/Region Allocator in C++ (rev 2)
2nd revision of original post: Arena/Region Allocator in C++
Context, changes
Trying to get a better grasp on low-level memory management, I implemented an arena allocator in C++. It's a rough ...
9
votes
1
answer
649
views
Arena/Region allocator in C++
Update: 2nd revision on separate post: Arena/Region Allocator in C++ (rev 2)
Original Post
Trying to get a better grasp on low-level memory management, I implemented an arena allocator in C++.
It's a ...
14
votes
2
answers
537
views
Custom implementation of `std::unique_ptr<T>`
I skimmed through the documentation on cppreference.com and put down the basic functionalities expected out of a unique_ptr<T> implementation. I coded up a ...
2
votes
1
answer
75
views
I have a pytorch module that takes in some parameters and predicts the difference between one of it inputs and the target
One instance of the following module uses up to almost 75% of my vram. So, I was wondering how I could improve that without slowing down runtime too much. The code is below:
...
2
votes
0
answers
135
views
Allocate managed objects in C# on the native heap
This is a pretty basic class to allocate objects from the native heap. The whole process goes as follows: allocate bytes from NativeMemory.Alloc, set the method table pointer from an existing object, ...
2
votes
1
answer
141
views
Javascript Signals implementation
I've created my own implementation of signals in typescript, inspired by the proposed tc39 specification (https://github.com/tc39/proposal-signals) in the BOM. I think it would be great if I could use ...
4
votes
3
answers
695
views
Error handling for singly linked list in C
I have seen many list implementations in C in this site; I know its been asked many times. I need some advice regarding:
Quality of my code, especially my list library.
How to handle errors in main (...
3
votes
1
answer
246
views
Presence of UB and memory usage of a std::array initialization
I proposed several techniques to answer to https://stackoverflow.com/q/78672409/21691539.
A classical way to answer would be to use std::index_sequence-based ...
5
votes
1
answer
225
views
Unit Tests for an Arena Allocator
In my last post about the allocator, I received some comments about unit-tests:
The code looks correct on the majority of the cases, I will suggest run valgrind or define a good set of unit tests ...
- The Overflow Blog
-
- Featured on Meta
-
-
Related Tags
c++ × 264
c × 191
performance × 87
c++11 × 57
pointers × 57
c# × 55
linked-list × 42
beginner × 39
array × 36
strings × 34
memory-optimization × 32
java × 30
python × 29
object-oriented × 20
c++17 × 17
vectors × 17
javascript × 16
c++14 × 15
error-handling × 15
algorithm × 14
objective-c × 13
template × 13
.net × 12
csv × 12
more related tags
Hot Network Questions
- Why does Timor-Leste call itself a "Democratic Republic" despite little apparent Marxist-Leninist ideology?
- How do pre‑tribulationists interpret Matthew 24:29–30 about the Son of Man appearing "after those days"?
- Civilian airplanes with inside fuselage jet engines
- Are you allowed to take a slow release capsule of caffeine on Shabbos to help you fast on Tisha Bav - Sunday or is it hachana for the weekday?
- Balancing a Holy Water Bomb
- Book recommendations for theistic books about God's existence
- How can one circumvent the "\unexpanded" condition imposed by LaTeX3 clist module?
- When was thermal expansion in solids first described?
- An SF novel where a very young child escapes being murdered by hiding in the water tank of a toilet
- wifi problem with regulatory domain settings
- PoE center tap vs dedicated V+/V-
- How did composers in the 18th and 19th century manage to be so productive?
- How to do non-greedy multiline capture with recent versions of pcre2grep?
- What is the outcome when an officer's statement under oath contradicts video evidence
- Why do we name and separate invisible bands even though the EM spectrum is continuous?
- Film or TV series about powerful man who is banished, fishes beings he creates from ponds
- Do a linearly sloped electric field and uniformly increasing magnetic field satisfy Maxwell's Equations? An apparent paradox
- Is there a name for the beat in drum and bass that is a distillation of the amen break
- How to find all PDAs before closing a program
- Can the term "iso-polyphony" be used generally, or is it considered only Albanian?
- How to scale down a benzene inside a larger molecule
- Voltage-Controlled 555 Timer?
- What is the parity of a neutrino?
- Can I combine 2 car reservations on adjacent dates with Hertz?