Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
8 replies
196 views

If we have dynamic memory allocation, which is best for using the memory efficiently, then why do we use static memory allocation every time? Can't we use dynamic memory everywhere??
Raj Sharma's user avatar
Advice
0 votes
7 replies
171 views

As a beginner I don't understand why pointers are being used everywhere . When I got to know about pointers, I had lots of questions: Why can't we simply use another variable to store the value of ...
Raj Sharma's user avatar
-4 votes
0 answers
45 views

I am using fastapi as backend and react for frontend. Currently, I'm rendering data (as chunks i.e., 500 records per chunk) which is a stream coming from websockets. And then I'm using visualization ...
Heisenberg's user avatar
-5 votes
0 answers
80 views

I am using fastapi as backend and react for frontend. Currently, I'm rendering data (as chunks i.e., 500 records per chunk) which is a stream coming from websockets. And then I'm using visualization ...
Heisenberg's user avatar
Advice
0 votes
0 replies
77 views

I am writing cause I wanted to get some opinions from folks here that have actually built and shipped with Electron. Background: Building an API IDE on Electron. Not really “just an API client”, and ...
NikolasDim's user avatar
Advice
0 votes
10 replies
168 views

I am trying to learn malloc() in C. My question is regarding how the values are stored once I malloc the memory. To understand this, I wrote the following program: size_t n_bytes = 4; char *mmry_ptr = ...
Divyang Prajapati's user avatar
2 votes
0 answers
124 views

I have a C++ hash map class that I'm writing natvis code for in order to easily inspect its members while debugging. One member of the class is char* myControlBytes which is an array of chars/bytes ...
Frax's user avatar
  • 99
0 votes
1 answer
126 views

I am creating a project for an ESP32. I'm quite new to ESP and C++ coding. I use PlatformIO inside VSCode. It's a robot that will be driving around. It has Ultrasonic sensors to detect any obstacles. ...
Ben Scheid's user avatar
Advice
0 votes
7 replies
125 views

I was thinking about floats and doubles and was wondering if the fact that they use 32 bits and 64 bits respectively means there is a performance increase either in terms of memory used or time for ...
pcrt's user avatar
  • 1
Best practices
0 votes
1 replies
115 views

“I’m fine-tuning a transformer with batch size 8 and getting CUDA out-of-memory errors. Would gradient checkpointing or mixed precision help?”
Colin Leede's user avatar
Best practices
0 votes
12 replies
174 views

I am needing to manage memory for object allocation manually. I have been using a alignas(T) char storage[] array with dynamic casts. But what I really want is an array of uninitialized values. Can I ...
Sudo Bash's user avatar
  • 433
4 votes
1 answer
195 views

P = y.T @ (np.diag(Wc) @ y) This line is creating increased memory usage for me in the below code on my Windows 11 machine. As soon as I run the code, I see the RAM usage increasing and skyrocketing. ...
you_know_who's user avatar
4 votes
1 answer
157 views

I have a Go function for encrypting data in parallel using AES-GCM: func encryptParallel(ctx context.Context, aead cipher.AEAD, w io.Writer, r io.Reader, workers uint64) error The design is: One ...
Onyz's user avatar
  • 83
-1 votes
1 answer
307 views

What is the size of a std::function? If the size is dependent on something, is there a theoretical maximum? The size of closure (lambda function) not same as std::function or pointer explores the ...
noNameTed's user avatar
  • 371
Best practices
2 votes
3 replies
106 views

I am currently trying to implement a slot map and I have a few issues with memory management, if I have an std::array<Storage, Size> where Storage is the following struct: struct Storage final { ...
a a's user avatar
  • 384
Advice
0 votes
5 replies
126 views

Our ASP.NET Core Web API needs to request data from an external web service (and no, the external web service cannot be called directly from the client) and return it without modification to the ...
R. Hoek's user avatar
  • 1,145
6 votes
1 answer
245 views

In my kernel, I receive a physical pointer to a device tree through the C ABI, should I make the type of this parameter a pointer or a usize? If I use a pointer, does Rust assume I have provenance ...
CocytusDEDI's user avatar
3 votes
2 answers
283 views

I've seem to run into something I can't really explain. I'm testing out passing a struct (typedef with an alias) by value into a function and printing out the addresses of each. I do realize that ...
Maryann's user avatar
  • 79
Best practices
0 votes
3 replies
157 views

I want to generate a memory access trace in Linux where every fixed number of memory accesses (e.g., every 32 accesses) are grouped and recorded as one batch. Is it possible to implement this kind of “...
456 123's user avatar
  • 19
0 votes
0 answers
57 views

My understanding is i386 has segment registers with 16bit like CS it can point to code_descriptor in the GDT that should be in the RAM, to be able to reach to it we need 32bit address : How can CS ...
mx14slh's user avatar
  • 129
Best practices
0 votes
2 replies
154 views

I’m looking for simple, commonly used techniques to reduce memory usage in a React Native app. One example I’m already using is avoiding unnecessary screen instances in React Navigation (e.g. using ...
Sunii's user avatar
  • 314
Advice
0 votes
2 replies
28 views

Most compiled languages provide macros for embedding data into executables (#embed in C, include_bytes! in Rust etc.) however, one thing that bothers me about them is that they put the data into ...
yxER's user avatar
  • 1
0 votes
0 answers
106 views

problem--why the large string log data cause the jvm memory go high? problem: the java process is using more and more memory over time. jvm argument:java -Xmx5120M -Xms5120M -XX:NewRatio=1 -XX:...
walker_fish's user avatar
3 votes
2 answers
249 views

I duplicated the topic because (possibly) I made a mistake with the section of the site and initially posted in the wrong place: Ways to reliably read an object in C I have a regular byte buffer ...
Evgeny Ilyin's user avatar
2 votes
1 answer
102 views

I have a Python function that consumes a large amount of memory. When the function finishes, I want to release the memory and return the freed pages to the operating system by calling malloc_trim(0). ...
pixeldrift's user avatar
1 vote
1 answer
163 views

I'm facing an AlignmentMismatch error while trying to cast a Vec<u8> to Vec<T>, where T is a struct that uses repr(C) and Pod + Zeroable. I've also tried the slice road &[u8] -> &...
Sigma Octantis's user avatar
0 votes
1 answer
115 views

This is a bit of a slog so bare with me. I'm currently writing a 3D S(moothed) P(article) H(ydrodynamics) simulation in Unity with a parallel HLSL backend. It's a Lagrangian method of fluid simulation,...
Ben Williams's user avatar
0 votes
1 answer
99 views

I am trying to analyze a memory dump obtained with dotnet-dump from a Ubuntu container in WinDbg to find an unmanaged memory leak. I have been able to load the dump, but whenever I try to run !heap -s,...
Steve's user avatar
  • 9,635
2 votes
0 answers
127 views

Goal I want to write a function in Rust using the Polars crate that does the following: Copy a Parquet file from one location to another Handle files larger than RAM Not load the entire file into ...
Horowitzathome's user avatar
Best practices
2 votes
6 replies
177 views

If I have a server written in golang that processes requests containing user queries, is there any viable method to track and limit the memory used by any given user request? The server process does ...
Craig Ringer's user avatar
2 votes
1 answer
161 views

Consider the example code: from functools import partial from jax import jit import jax.numpy as jnp @partial(jit, static_argnums=(0,)) def my_function(n): idx = jnp.tile(jnp.arange(n, dtype=int)...
Ben's user avatar
  • 613
0 votes
0 answers
64 views

I'm attempting to use Massif to profile heap usage of an application. I'm running with the --pages-as-heap=true option and am confused by some output I'm seeing. Specifically I'm seeing allocation by ...
Kevin's user avatar
  • 549
3 votes
3 answers
363 views

I'm trying to do the very basics of a buffer overflow, nothing illegal at all. My understanding of the code below is that the overflowing buffer doesnt hold enough space for all the data being written,...
Luke's user avatar
  • 37
0 votes
1 answer
103 views

I have some Python code running in k8s which in some cases is being OOMKilled and not leaving me time to cleanup which is causing bad behavior. I've tried multiple approaches but nothing seems quite ...
Aharon Sambol's user avatar
3 votes
2 answers
171 views

I am confused why my application is somehow slower when I run it by executing the .exe file from the publish folder, compared to running it from Visual Studio debugger (F5). I use .NET 8.0 and this is ...
Viki Theolorado's user avatar
0 votes
0 answers
54 views

My single threaded program allocates and initializes a volatile block of memory on an unspecified hardware architecture. It then writes into this block in a loop using a stride equal to the cache line ...
mafu's user avatar
  • 33.1k
0 votes
0 answers
69 views

I am using h2o-3 java repo to load this frame but have been running into memory issues with constant GC pressure. The actual frame size is 3.31 GB as per h2o logs, but the peak JVM usage comes to be ...
Monil Patel's user avatar
0 votes
1 answer
215 views

I don't know how to check or increase the memory limitation of duckdb wasm. I'm using chrome and I import some parquet into the browser, one of them has 234Mb of data I did my research and the limit ...
Antho's user avatar
  • 1
-2 votes
1 answer
135 views

I’m experimenting with sorting large arrays of unique integers in JavaScript and came up with a simple approach. I’m curious if it’s a recognized pattern or if there are potential pitfalls I might be ...
Aaron's user avatar
  • 1
0 votes
1 answer
91 views

I am trying to combine a background video with captions generated word by word from a tts file. I am using nvenc for ffmpeg but my gpu's cuda version is too old to use it for whisper. The script works ...
JuanPlayz's user avatar
1 vote
1 answer
150 views

I tried it with -fsanitize=address and it didn't show any error. Is this a problem with my address sanitizer or system, or is this normal? Also, how to catch these situations? #include <iostream>...
Zebrafish's user avatar
  • 16.9k
0 votes
1 answer
550 views

I have a Nuxt 3 production app hosted on Scalingo (it's like Heroku but is a french company) I have so many container crashes because of memory issues when a lot of people are browsing the website. ...
Sw0ut's user avatar
  • 814
0 votes
1 answer
138 views

See the below logs, A critical kernel driver cannot apply for a large block of continuous memory and then panic: [29001.362425] kworker/u12:4: page allocation failure: order:4, mode:0x40dc0(GFP_KERNEL|...
wonderzyp's user avatar
1 vote
1 answer
125 views

I am designing a library where I need AWS SDK for S3 and Kinesis as wrapped sub-components. In an executable, Aws::InitAPI() and Aws::ShutdownAPI() can be called once, so I am trying to design a ...
Amirul I's user avatar
  • 319
0 votes
0 answers
141 views

From another thread I found that indeed allocates enough storage to hold at least n elements, but it doesn't actually fill the container with any elements If elements are already allocated why ...
sat0sh1c's user avatar
3 votes
0 answers
144 views

I'm working on several projects that are targeting bare-metal multi-core microprocessors, with hardware provisions for shared memory. In other words, the device has several separate CPU cores (of ...
Fake Name's user avatar
  • 5,953
1 vote
1 answer
134 views

I want to clarify how modern x86 architectures handle the latency of memory transactions that go all the way to DRAM. Specifically, which resources (which queues) get occupied waiting for the memory ...
xealits's user avatar
  • 4,838
0 votes
0 answers
26 views

I found the count of an API in alloc_calls is not increased over time and decreased if I free allocated memory. Is this true? So if I unload the driver, the API should disappear in the alloc_calls ...
samp lin's user avatar
1 vote
1 answer
127 views

I'm trying to read a variable from another process' memory in C and upon first query, for which I'm using VirtualQueryEx function, some potentially matching values are returned. However, when I change ...
ACarrot's user avatar
  • 63
2 votes
2 answers
212 views

I have read a post about Why we need memory alignment. I mostly focus the effects on the performance when CPU read memory. The CPU always reads at its word size (4 bytes on a 32-bit processor), so ...
bod's user avatar
  • 33

1
2 3 4 5
730