Questions tagged [memory]
Memory refers to the physical devices used to store programs or data on a temporary or permanent basis for use in a computer or other digital electronic device.
316
questions
1
vote
1
answer
292
views
Protecting garbage collection data structure with reader-writer lock might not be appropriate?
I'm thinking about implementing garbage collection efficiently by protecting the structure that tracks allocations using reader-writer lock. However, I'm worried memory semantic may invalidate the ...
1
vote
2
answers
462
views
Does Java keep stream objects in memory after mapping them?
Say I have the following stream:
List<Other> list = Stream
.of(
new MyObject(),
new MyObject()
)
.map(this::mapToOther)
.collect(toList())
;
So after this is ...
0
votes
5
answers
219
views
Load and process (compressed) data from filesystem in the blink of an eye
We have a huge amount of queries hitting our API that request a minor or major extract of some huge files lying around on our mounted hard drives. The data needs to be extracted from the files and ...
1
vote
2
answers
144
views
How to store an encrypted filesystem in a single file on disk on multiple platforms (maybe not portably), or alternatives
I'm in the very conceptual phase of designing an open source password manager that provides distributed Vaults that can be simultaneously accessed and managed from multiple devices with the promise of ...
0
votes
2
answers
187
views
Sandboxing interpreted code
I have a little pet compiler project that generates bytecode interpreted by a virtual machine. The language is kind of low-level, as it allows the user to manually allocate memory and dereference any ...
2
votes
2
answers
233
views
Optimizing Flash Memory Writes in Embedded Systems with Unpredictable Power Loss
I'm working on an embedded C++ project that involves logging certain types of statistical data (like successful accesses, failed attempts, and other events) to the flash memory (just incrementing ...
1
vote
4
answers
273
views
Is the maximum number of outstanding load instructions limited by the CPU architecture or the program?
I'm reviewing some lecture slides and had a question on the following slide :
Assumptions (8 clocks to transfer data) Up to 3 outstanding load requests.
The slide is illustrating that the number of ...
3
votes
3
answers
419
views
What is the best way to retain a local object which is performing an asynchronous task?
My problem is the following: inside a method I'm creating an object like this:
MyObject* myObject = [MyObject new];
Then I want it to perform an asynchronous task like this:
[myObject ...
0
votes
1
answer
678
views
C++ wrapper around raw array - memory management
I have simple wrapper class around C-style array. I don't want to use std::vector since I want to have only one array even if I do copy of the struct. With std::vector the vector is also copied.
...
-1
votes
2
answers
360
views
what algorithm does the malloc function in the c language standard library use? And why it so fast?
Based on the data structure of the AVL tree, I implemented a memory manager that does the best matching according to the size. I originally thought that the speed would be fast and the length of the ...
0
votes
1
answer
219
views
Sink or non-sink API's?
This might be an opinionated question but I'm eager to hear your anecdotes as I'm at the beginning of designing a new API. Now I'm questioning whether I want this API to be a sink API or non-sink API. ...
8
votes
3
answers
229
views
Choosing one of two memory blocks to deallocate: Does age affect fragmentation?
First question here, so preemptive apologies if I've committed some faux-pas. Additionally, I am aware that this question is about possibly the micro-est of micro-optimizations ever, and "micro-...
0
votes
3
answers
109
views
How multiple type lists are stored in memory?
Arrays are stored in a linear fashion, with memory cells of fixed size for each element. To have fixed sized memory cells Arrays should be homogenious. So in Arrays we get an Nth element by skipping ...
1
vote
3
answers
546
views
Memory on multiple cores versus 1 core
I am running a program that, among other things, does some matrix multiplications, singular value decompositions and accessing matrix subsets on a very large data set (these are the lines of code that ...
1
vote
4
answers
2k
views
Memory Alignment
I want to make sure I understand the concept referred to by alignment:
Is it just a way of making sure that you never have a non-integer number of words? The wikipedia page says in order for an access ...