13 questions from the last 30 days
24
votes
2
answers
2k
views
Why do JavaScript Websocket objects not get destroyed when they go out of scope?
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 ...
2
votes
2
answers
75
views
Can you construct a NULL-terminated GPtrArray that doesn't have an element_free_func?
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, ...
0
votes
1
answer
179
views
Identifying a failed null check
I am working on a function that must read one line at a time from a file, give the file descriptor of said file as input.
Here is my get_next_line function, and helper functions on top of it
# include ...
Advice
0
votes
2
replies
74
views
What prevents Javascript memory leaks in software applications?
I was thinking back to WinJS or WinUI with Windows Universal Applications (WUA) from about 10 years ago. I am wondering how it compiled and avoided typical architecture errors. If there is no memory ...
-2
votes
0
answers
47
views
How to properly implement reference counting in Linux kernel modules to prevent use-after-free vulnerabilities? [closed]
I'm developing a custom Linux kernel module for managing device resources, and I need to implement proper reference counting to prevent use-after-free (UAF) vulnerabilities.
My module maintains ...
0
votes
1
answer
31
views
Why does heavy object cloning degrade JS performance even when using structuredClone compared to manual optimization?
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 ...
-1
votes
0
answers
19
views
Kubernetes memory of pod over time [closed]
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 ...