Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

In a high-performance Node.js service, I noticed that structuredClone() introduces unexpected latency spikes when cloning large nested objects (30–50 KB each). Even switching to manual cloning ...
Chand jr's user avatar
2 votes
2 answers
74 views

I'm writing some C code where I want to have a NULL-terminated GPtrArray containing static strings. Typically, I would use g_ptr_array_new_null_terminated () to construct a NULL-terminated GPtrArray, ...
Newbyte's user avatar
  • 3,957
-1 votes
0 answers
19 views

I'm having a pod which is eventually reaching thrashing, I'm running 200 golang binary (main.bin) in a pod of 128 MiB because of a resource issue. Ofc, I can increase the memory for it to not ...
reddy nishanth's user avatar
1 vote
0 answers
56 views

We are using Matlab to communicate with a C++ library, and are struggling with memory management. We create a libpointer pointing to an array, and then try to update its value in a loop. I don't think ...
RPM's user avatar
  • 1,809
Advice
3 votes
4 replies
174 views

public class Test{ static int add (int m, int n){ return m+n; } public static void main (String[] args){ int a=1; int b=2; int c= add(a,b); } } ...
Sebastian Mueller's user avatar
8 votes
0 answers
172 views

I'm working in an ESPHome / embedded C++ environment, where exceptions are disabled, so std::vector::resize() won't throw std::bad_alloc on allocation failure. I need to resize a std::vector to match ...
Luigi's user avatar
  • 411
24 votes
2 answers
2k views

In JavaScript, when you do something like this, function connect() { var ws = new WebSocket(url); ws.onmessage = function(e) { window.alert(e.data); }; } it will work. But why ...
Maestro's user avatar
  • 9,846
2 votes
1 answer
125 views

We have something that looks like this: abstract class TreeNode { internal abstract Branches GetChildren(); } class Leaf : TreeNode { internal override Branches GetChildren() => ...
Joshua's user avatar
  • 43.6k
1 vote
2 answers
193 views

I am using an Ubuntu 16.04 a 32-bit Virtual Machine OS. I executed sysctl -w kernel.randomize_va_space=0 to disable ASLR in root prior to gcc. I have also compiled this using the command: gcc -g -fno-...
Wabba Fett's user avatar
4 votes
2 answers
190 views

I have a web app written in Delphi 12 using TMS Webcore components. At logout (which happens by user action, or after idle timeout), I want to clear the memory for security reasons, in case there are ...
Rohit Gupta's user avatar
  • 4,277
0 votes
0 answers
163 views

I am aware that calling delete this in a member function is not UB in itself. In fact, compiler is doing the very same thing when one calls delete ptr, ptr being a pointer to a polymorphic object (...
lobelk's user avatar
  • 531
3 votes
0 answers
152 views

I try to understand how ::operator delete sync with other atomic operation. Is any atomic::write --SC-order--> ::operator delete in the same thread? atomic<void*> A; T1: old = A.read(relaxed);...
Alex's user avatar
  • 31
-3 votes
2 answers
183 views

I have std::map of std::vector of raw pointers. According to Google AI, in order to clean it I should do: int main() { std::map<int, std::vector<MyObject*>> myMap; // Populate the ...
Igor's user avatar
  • 6,473
-5 votes
2 answers
176 views

I'm writing a program that is very sensitive to garbage collection so I'm trying to avoid allocating to the heap after initialization. In the example below, calling Run() will allocate to the heap ...
ATD's user avatar
  • 892
0 votes
0 answers
56 views

Apologies if I didn't perform any checks or standards for my query. In my app with packages:- react-native 0.79.5 Expo 53 expo-file-system 18.1.11 and react-native-blob-util 0.22.2. I am trying to ...
Raeygzz's user avatar
  • 61
2 votes
1 answer
110 views

I am trying to implement a custom global allocator for use in my Rust application. The goal is to track memory usage and align to 64 bytes. My allocator uses libc::malloc and libc::free for allocation ...
Ronika Kashyap's user avatar
2 votes
1 answer
97 views

I am using WebAssembly to implement a sandboxed plugin system in a C application. Users can write plugins in any language that will compile to WASM, and we just say "you can import a, b, c ...
Logan R. Kearsley's user avatar
1 vote
1 answer
192 views

TLDR: I have a huge array (around 70% of available memory) and I don't want it to be swapped to disk. What's the best way on modern linux to pin a vector in memory so that it doesn't get swapped by ...
Mascarpone's user avatar
  • 2,578
0 votes
3 answers
211 views

I often see both terms — JMM (Java Memory Model) and JVM (Java Virtual Machine) — when learning about multithreading and memory management in Java. However, I'm confused about how they relate to each ...
Nurlis Kimbiletov's user avatar
2 votes
2 answers
194 views

I have this class: class Socket { [...] pollfd* fdPtr; }; And I have a Manager class that creates the actual pollfd objects and adds them to a std::vector named pollFdsVec, to then poll on ...
desynchedneo's user avatar
2 votes
2 answers
160 views

I am designing a memory allocator that is able to move objects during their lifetime. To support this it requires use of IndirectPointer that points to a control block. This control block points to ...
Aedoro's user avatar
  • 940
2 votes
1 answer
144 views

I'm studying std::move semantics and I would like this to be clarified to me: Say I have: // Message.h class Message { private: std::array<uint8_t, BUFFER_SIZE> buffer; std::queue<...
desynchedneo's user avatar
-1 votes
1 answer
103 views

I implemented a function to return the Pascal Tree of numRows rows in 2 ways: // Making a copy of the last element class Solution { public: vector<vector<int>> generate(int numRows) { ...
Harshit Tomar's user avatar
0 votes
1 answer
45 views

In a microcontroller without any OS, how does the microcontroller keep track of where a malloc will point to in the heap? char *x; char *y; char *z; x=(char*)malloc(10); y=(char*)malloc(10); free(x); ...
hal's user avatar
  • 1
2 votes
0 answers
67 views

I'm trying to understand how memory is used in my async Python application. I have multiple coroutines running, and I want to see how much memory each one is using, especially when they are nested or ...
Optidev's user avatar
  • 218

1
2 3 4 5
555