27,710 questions
2
votes
2
answers
52
views
C++20 Constexpr vector
The latest C++20 standard supports dynamic allocation memory in compile time with a limitation. The memory allocation cannot “go outside” the constant expression. That means that vector cannot be ...
2
votes
0
answers
49
views
How does Python's garbage collector handle circular references in custom objects?
I'm working with complex data structures involving custom classes that reference each other.
I’m aware that Python uses reference counting, but also has a cyclic garbage collector for circular ...
0
votes
0
answers
30
views
improve the performance of time-shifted design matrix function using PyTorch
I am using the following function to create a design matrix that is then used as input in a linear model.
import numpy as np
import torch
def _compute_shifted(
feats_t: torch.Tensor,
delays: ...
-3
votes
1
answer
47
views
Is using a garbage collector for a game THAT bad? [closed]
I’ve been making simple games by trying out different languages with different frameworks to see what works the best for me, and I’ve been hearing that using garbage collected languages like C#, Java ...
0
votes
1
answer
34
views
Diference between pgprot_noncached() and set_memory_uc()
I want to allocate a memory region who's pages can selectively have their cache disabled. For example, allocate 1 MB (256x4K pages) where, as the execution goes on, specific pages get set to ...
0
votes
0
answers
90
views
How to process large files efficiently with generators in Python without memory issues?
I’m working on a data processing pipeline in Python that needs to handle very large log files (several GBs). I want to avoid loading the entire file into memory, so I’m trying to use generators to ...
1
vote
2
answers
55
views
Integer stored in 0 bytes
The datatype for SQLite page says:
INTEGER. The value is a signed integer, stored in 0, 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
I'm not so sure on how we can store an ...
0
votes
2
answers
59
views
Angular Memory Management
I am trying to understand if there is an easy way to unsubscribe automatically from observables/subjects.
For example, lets say I have a component
@Component({
selector: 'mySelector',
template: `...
5
votes
0
answers
59
views
How does the caching system in a cpu decide which memory is to be stored in L1/L2/L3 caches as they're being accessed
I am trying to understand in a general sense how L1/L2/L3 caches are updated and how the updates are propagated in a multi-core x86/x86-64 CPU.
Assuming a 4 core CPU and 2 pairs of L1/L2 caches, where ...
1
vote
0
answers
26
views
AWS SDK S3 GetObjectAsync crashes with ResponseStream in Unreal Engine - how to fix?
I'm using AWS SDK for C++ (v1.9+) in Unreal Engine to download files from S3, but I keep getting crashes in aws_cpp_sdk_core!Aws::Utils::Stream::ResponseStream::ReleaseStream()
Here's my exact code:
...
0
votes
0
answers
25
views
Does a high size value in Elasticsearch terms aggregation increase memory usage if fewer buckets are returned?
I'm using a terms aggregation in Elasticsearch and have a question about the size parameter.
If I set size: 1000 in the aggregation, but the actual number of buckets returned is always much lower—say ...
1
vote
4
answers
109
views
Why doesn't JavaScript's garbage collector clean up global variables? [closed]
I've been reading an article about memory management in JavaScript, and it says that the global scope objects don't get cleaned from the memory.
If a global variable is not being referenced anywhere ...
0
votes
1
answer
39
views
Does DMA play a role in process loading (from disk to memory)?
I’m trying to understand how operating systems load a program into memory from a hardware perspective.
I know that DMA (Direct Memory Access) is used for I/O operations, allowing data transfer between ...
1
vote
0
answers
53
views
Why does Chrome black out, or crash with "aw, snap - out of memory" when there is still plenty of memory available?
I'm developing a Svelte-based Javascript single-page app with a lot of Apache ECharts displays in it that is fairly heavy in both DOM elements and array data, but generally stays in the 400-500MB ...
0
votes
0
answers
12
views
How to cap memory allocation for Tomcat
How to cap memory allocation for Tomcat so that system utilises only capped memory and not above that. Currently am trying to cap using setenv.sh but system is using more that what is allocated