Questions tagged [memory]
Use this tag for memory management or issues in programming. For questions about memory hardware issues or errors in general software, go to https://superuser.com, or https://serverfault.com if this is related to enterprise-level hardware or software.
34,353
questions
0
votes
0
answers
15
views
Monitor not showing the right memory usage
I want to know how I can use the resource monitor, any kind, htop top, etc. to track the memory usage of a processes. Let's write a simple C program.
int main() {
while(1){}
return 0;
}
After ...
0
votes
0
answers
13
views
Python's memory-profiler reveals np.random taking up too much memory
I am using Python's memory-profiler to better understand how much memory my code is using and when setting up this simple example, I found a much higher memory usage than expected:
from ...
4
votes
1
answer
32
views
What causes this bug to be non-deterministic
Recently, I wrote the following, buggy, c code:
#include <stdio.h>
struct IpAddr {
unsigned char a, b, c, d;
};
struct IpAddr ipv4_from_str (const char * str) {
struct IpAddr res = {0};
...
0
votes
0
answers
20
views
What is the memory usage of a reference to another object in java?
If for example, I had a linked list of nodes. Each having a field referencing the next node. How much memory does this reference (not the next object) take?
E.g if I have:
Class Node
nextNode node;
...
0
votes
0
answers
9
views
When functions are assigned to variables, how are they stored?
Normally, if you create a variable, it's usually trivial how to store it in memory, just get the size of it (or of all of it's components, for example in structs) and allocate that many bytes in ...
0
votes
1
answer
38
views
c++: how to delete a pointer created/modified in an async function?
I am very confused of how to delete a pointer that's has been called from async function.
What do I have:
Obj* doStuff(int size){
Obj *myObject = new Obj(size);//where do I delete this?
myObject....
0
votes
1
answer
27
views
Memory usage of a char array with null values in Java
I'm attempting to calculate the memory usage of a trie search tree implementation in java. Each node contains a char array of size 52, with many of the indices being null values. I'm aware of the ...
0
votes
0
answers
13
views
vscode remote ssh with Linux has a memory issue
Im using VSCODE remote ssh to connect Linux server.
and I sometimes build nuxt project and sometimes stop build process because of memory.
(PID 17984 is nuxt project.)
there are 6 processes about ...
-1
votes
1
answer
14
views
What sort of address is 0x0000000140001000?
I'm using IDA Pro and right at the top of file is a field labelled Imagebase. Would this address be a absolute virtual address or relative virtual address or something else ?
0x0000000140001000
0
votes
0
answers
5
views
Address used by dma is physical or virtual
My question is the address written in dma descriptor is physical address or virtual address
And what is IoMmu and how it's physical to virtual mapping works
0
votes
0
answers
25
views
Does an access on the page cache require an adress translation from the mmu?
I have a little problem in understanding the working of the page-cache in linux. If I understood it right the page cache gets filled with pages the kernel recently allocated. Is it correct that, if ...
0
votes
0
answers
24
views
Opencv Throws an Exception in a Display Callback Function of an MFC App
thanks for reading in advance and hope this question is helpful for others in the future as well.
Please take a look at the code first.
void DisplayThread::OnBufferDone( PvBuffer *aBuffer )
{
...
-1
votes
2
answers
70
views
Is it possible to destroy the memory via pointer?
First I promise that I won't do anything bad with this. I'm just curious.
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char ** argv) {
int* p;
while (true) {
*...
0
votes
0
answers
22
views
NodeJS heapUsage unchanged when using fs.readFile vs streams
I've been learning about memory management in Nodejs and I'm trying to understand why the following two behaviors occurs:
PS: I'm using the following utility functions to help me print memory to ...
2
votes
1
answer
22
views
how python [0] * 3 are independent but [[0] * 3] * 3 each sub list is the same object? [duplicate]
my_list = [0] * 3
my_list[0] = 1
outputs to
[1, 0, 0]
my_2ndlist = [[0] * 3] * 3
my_2ndlist[1][1] = 5
outputs to
[[0, 5, 0], [0, 5, 0], [0, 5, 0]]
I think I know that
x = 1
y = 1
makes x and y point ...
0
votes
2
answers
62
views
How do I search most common words in very big file (over 1 Gb) wit using 1 Kb or less memory?
I have very big text file, with dozens of millions of words, one word per line. I need to find top 10 most common words in that file. There is some restrictions: usage of only standard library and ...
-1
votes
0
answers
27
views
Dynamic allocation for structure array in C database
I am trying to create a database in C. It has to have 3 functions: add new data, delete data and sort the data. I want the program to read the data and store it in an array of structures, so I can ...
1
vote
0
answers
26
views
Can Unity handle perfectly multiple render of differents sizes of the same picture?
If I have two pictures slots in my game, one displayed as an icon and one displayed as the full image.
Should I have two differents pictures in my Resources folder or can I use the same picture ?
The ...
2
votes
1
answer
53
views
Refactoring an algorithm to avoid inefficient slicing of a large Numpy array
I have a working algorithm to analyse experimental datasets. This algorithm is made of two main functions. The first one takes a large array as one of its inputs and returns an intermediate 3D, ...
-1
votes
1
answer
56
views
Is there a way to find exact location ( adress ) of file on disk?
I'm developing a software using C++ for Windows/Linux.
I want to create a file (txt, json, license, you name it) at runtime, and save it somewhere. Is it possible in C++ to get the exact position of ...
-1
votes
1
answer
32
views
Modify data in memory with python
suppose I have a variable with a numeric value of 20.
we used the id() function to get its memory address.
How can the numeric value of 20 be changed to, for example , 40 using the memory address?!
as ...
0
votes
0
answers
6
views
Is the bus size fixed when reading data from memory(dram)?
I've learned why padding is there when we create variables smaller than a word size. The answer for that is for the performance, because memory space is word-aligned and data read is done word-size at ...
0
votes
0
answers
31
views
Supposing no dynamic memory allocation by hand, what can cause "free: invalid pointer" error [closed]
Problem
I have following struct: (Slightly modified from the original code but almost same)
struct Node
{
double x;
double y;
double ...
0
votes
1
answer
20
views
how to fix the thread tried to read from or write to a virtual address for which it does not have the appropriate access
Last month i was experiencing some issues with games after i installed new RAM. i went from (2x4GB) 3000MhZ to (2x8GB) 3200MhZ and since then i kept getting crashes. Every game that i played crashed ...
1
vote
1
answer
33
views
Explanation for why effective DRAM bandwidth reduces upon adding CPUs
This question is a spin-off of the one posted here: Measuring bandwidth on a ccNUMA system
I've written a micro-benchmark for the memory bandwidth on a ccNUMA system with 2x Intel(R) Xeon(R) Platinum ...
0
votes
3
answers
44
views
Initialization of multiple empty lists in Python
What is the correct way to initialize a bunch of variables to independent empty lists in Python 3?
>>> (a, b) = ([],)*2
>>> a.append([2,3])
>>> a
[[2, 3]]
>>> b
[[2,...
1
vote
1
answer
57
views
When I call the C system() function, is the location of the new program's main() stack frame similar to the original program's main() stack frame?
I'm wondering if when I call the C system() function, the location of the new program's main() stack frame is similar to the original program's main() stack frame. Do anyone knows?
Below is "...
0
votes
0
answers
9
views
AWS CloudWatch Alarm for Aurora Instance Memory Utilization above 80%
I am looking to create a CloudWatch alarm to check for Aurora Postgres Memory Utilization. My requirement is to be notified when the Memory Utilization of an Aurora Instance stays above 80% for 5 ...
-1
votes
1
answer
59
views
leetcode, passes all test cases but time limit exceeded
this is a leetcode question to return the amount of subarrays that contain the greatest OR total, when doing OR operation on all the elements. for some reason my code passes all test cases but gets ...
0
votes
1
answer
17
views
Queries to increase memory usage PostgreSQL
I created an AWS CloudWatch alarm for Aurora PostgreSQL's Freeable Memory and wanted to test if it is created correctly. So looking for any queries to be executed on the Aurora PostgreSQL 12.8 which ...
0
votes
0
answers
24
views
Python function taking a lot longer than before?
I had used gensim and Word Mover's distance to generate a distance matrix for my text of ~4000. The first time I ran it, it took about a day or so. I am trying to run it again and it is taking more ...
-1
votes
0
answers
14
views
How to get CPU and memory utilization for linux(Centos 7) server for last 6 months
I need details of CPU and memory usage for last 6 months of a CentOS Linux 7 server.
0
votes
0
answers
24
views
Why does ReadWriteMemory return two different addresses?
I am trying to get the 64-bit memory address of a variable, using a pointer created with CheatEngine.
Here are the pointers:
from ReadWriteMemory import ReadWriteMemory
from numpy import int64
import ...
0
votes
0
answers
23
views
Why the same tasks cost differerent CPU on linux kernel 4.9 and 5.4?
My application is a compute intensive task(I.e. video encoding). When it is running on linux kernel 4.9(Ubuntu 16.04), the cpu usage is 3300%. But when it is running on linux kernel 5.4(Ubuntu 20.04), ...
0
votes
1
answer
37
views
Azure App Service Memory Usage. How & Where to see full drill breakdown of Memory Usage of all instance of App Service?
We are having java spring boot application deployed on Azure Application services.
We required help for below two points :
1.) We are not able to get complete break down drill report of memory usage ...
0
votes
0
answers
7
views
nd_pmem: probe of namespace0.0 failed with error -95. Problem to emulate NVDIMM on fedora
I am trying to emulate nvdimm on fedora 36 but i am Stuck with this probleme. I followed the steps from Intel on there website. https://docs.pmem.io/persistent-memory/getting-started-guide/creating-...
-4
votes
1
answer
37
views
Searching a specific bit pattern in given memory dump
I am asked to find a specific bit pattern which could have any number of bits in given memory. The bits could be spill over the byte boundary
Could someone tell me a generic logic to solve this ...
0
votes
1
answer
30
views
Basic variable declaration and memory in Javascript/Vue
I have a very basic question about declaring variable in Javascript/Vue.
function myFunction () {
let myVars = this.myVars;
forEach(myVars, (var) => {
// Do something with var
}
}
VS
...
0
votes
0
answers
10
views
Why do separate program executions use different amounts of memory?
I noticed that different executions of the same program take up different amounts of memory on Leetcode. Why would this happen?
-1
votes
0
answers
17
views
Operating system interrupt handler and CPU in virtual memory access
Which of these activities are performed by the CPU while execution the instructions and which by the Operating System (OS) interrupt handler that manages page faults? I am not sure about the ...
-1
votes
0
answers
15
views
Is there a way to get the current imagebase of a 64-bit .exe file in python?
I can get the prefered imagebase, but to calculate the memory address of a variable with a pointer, I need to get the current imagebase of the .exe file. Remember it´s 64-bit and calling the ...
-2
votes
0
answers
18
views
Does the Conditional (ternary) operator in JavaScript (used in many places as error prevention) place excessive strain on a controller/memory?
I'm adding some stability to my code and I want to make sure I handle null and undefined behavior. Usually I toss in some ternary logic to make sure I don't error out, but I'm wondering if this puts ...
6
votes
1
answer
94
views
Combining regex and ranges causes memory issues
I wanted to construct a view over all the sub-matches of regex in text. Here are two ways to define such a view:
char const text[] = "The IP addresses are: 192.168.0.25 and 127.0.0.1";
...
-3
votes
0
answers
59
views
How to get CPU base speed and memory speed c++ for linux?
I m working on Linux ubuntu 20-04 and I want to get cpu base speed and memory speed values with C++, how can I achieve this?
Remark: the value from /proc/cpuinfo is the current speed
0
votes
1
answer
15
views
Private Data in VMMap is very large on some machines
I'm trying to debug a memory exhaustion issue for my native Win32 CPP app, so far i have found that on some machine when launched, app the memory usage is very high from the beginning and VMMap is ...
0
votes
0
answers
7
views
writeBuffer() error when I try to download excel file with huge data in Exceljs
I'm trying to write excel file and download it by using ExcelJs in React. It's working well when I try with the small data but it's not good in the huge data using. i.e: I've 250K,500K data rows.
btw, ...
0
votes
0
answers
16
views
"runtime error: invalid memory address or nil pointer dereference" getting this error when using m3o space service in Golang
s := NewSpaceService(svc.Config)
res, err := s.Upload(&SpaceCreateRequest{
Name: fmt.Sprintf("images/%s.jpg", time.Now().Format("20060102-15:04:05")),
Object: ...
0
votes
0
answers
30
views
Access violation when executing ShellCode via CreateThread
I Created an executable that contains a Shell code.
The ShellCode is suppose to execute calc.exe.
I use CreateThread to execute the ShellCode.
The Shellcode is indeed executed and calc.exe spawns.
BUT!...
0
votes
0
answers
74
views
memory.limit() bug: "memory.limit() is not longer supported". Increasing memory
When I write "memory.limit()" I get the following bug:
memory.limit()
[1] Inf
Warning message:
'memory.limit()' is no longer supported
What I need is to increasing the memory size...
Thank ...
0
votes
0
answers
24
views
Are some detached DOM elements acceptable/unavoidable?
I'm building a React website and started getting an error message that there is a memory leak. Long story short, I figured out the source of the leak and resolved it, or at least got the error message ...