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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

How do I get more stack space for g++

I'm trying to allocate 3 fairly large matrices using g++ on a MacBook pro 2019 model running Monterrey 12.7.1 with 8GB "main" memory. The purpose of this code to compare C++ to Octave. Here'...
Vitit Kantabutra's user avatar
0 votes
0 answers
23 views

Process/Processor Synchronization without special instructions

My understanding is mutex in multi-core systems basically depend on being able to do an atomic compare + update operation. This consists of simultaneously checking the value of a flag and updating it ...
FourierFlux's user avatar
0 votes
0 answers
21 views

Creating a video from array of UIImages in iOS runs out of memory

I'm currently working on a project where I need to generate a 20-second video from a full-screen SwiftUI animation. Generating an array of UIImages was very simple. At 24fps, a 20 second video takes ...
Random player's user avatar
1 vote
2 answers
82 views

Guaranteed alignment of adress allocated by new expression

I am compiling the code with gcc 11.4 with -m32 -std=c++20 on Linux alignof(max_align_t) == 16 __STDCPP_DEFAULT_NEW_ALIGNMENT__ == 16 What is the guaranteed alignment that I should expect from new ...
Uriziels's user avatar
0 votes
0 answers
7 views

Error Starting up Camunda Zeebe 8.3.1 with docker-compose

After i have upgraded the CAMUNDA_PLATFORM_VERSION from 8.3.0-alpha3 to 8.3.1. There is error during startup as shown: zeebe | Picked up JAVA_TOOL_OPTIONS: -Xms512m -Xmx512m zeebe | [...
Akjun's user avatar
  • 391
0 votes
0 answers
27 views

Segfault on mprotect increasing memory

I am working on a computer with 8GB of memory with Ubuntu 20.04. I read a 4 GB file into memory, and now I want to create a virtual memory buffer using the memory that remains after the 4GB file. ...
RTC222's user avatar
  • 2,117
2 votes
1 answer
89 views

Large GB arrays on heap/static, macOS and Linux

I have trouble working with very large arrays in C, declared static to avoid the stack. On macOS, I can't even allocate 1GB. On linux, I can't go beyond 11GB. (Yes, I really have data sets that ...
ivo Welch's user avatar
  • 2,486
0 votes
2 answers
49 views

Accesing to value of 2D array using pointer arithmetic

I'm studying multy-pointers and I watched this video, where explains that, if we want to access the value of a 2D array, we use double indirection like this: #include <stdio.h> #include <...
Daniel Muñoz's user avatar
0 votes
0 answers
22 views

When I convert data between tensor of Pytorch and numpy, when do they share memory and when do they use new memory?

I write two pieces of programm. The first is: import torch c = torch.ones(3, 3) d = c.numpy() e = torch.tensor(d) e[0, 0] = 100.0 print(c) print(d) output is: tensor([[1., 1., 1.], [1., 1., ...
Frankenstein's user avatar
0 votes
0 answers
30 views

what(): fail. could not find VmRSS

The code I am trying to compile a .cpp file that generates a huge graph database. It is supposed to generate two TTL files; one for nodes and another for edges. I understand the graph is huge, hence ...
Tasbiha's user avatar
  • 104
0 votes
0 answers
31 views

Get available memory using PID in Linux/C and save it in a variable

At the top of my C program, I get the process ID and store it in a variable pid: pid_t pid; pid = getpid(); Using that PID (in this case, 21834), I want to get the available memory for that process ...
RTC222's user avatar
  • 2,117
1 vote
1 answer
40 views

Valgrind Memcheck Obscures Program's Memory Segments in /proc/self/maps

I am writing a thread simulation program in C which needs to know the lowest address of the stack segment so that it can read and write metadata needed for switching contexts. I find this address by ...
Robbie's user avatar
  • 127
0 votes
0 answers
64 views

What happened when I use "class::variable" when the variable is no static?

I know there is something logically wrong with the code itself, but ignoring these issues, I wonder why I am getting this output. #include <iostream> using namespace std; class Person { public:...
Baymiiing's user avatar
-1 votes
0 answers
4 views

Reading continuously 4kB from DDR gets some delay spikes [closed]

I wrote a program that reads 4kB blocks from a 1GB area in DDR. I’m using an Epyc 9004. A typical read of a block takes .1 usec. Unfortunately, regularly it takes 12 usec. What could I investigate?
a.dibacco's user avatar
  • 488
0 votes
0 answers
23 views

How to deal with Region cookie corrupted for region 0x160800000

I keep getting this memory issue during my programs runtime it keeps happening in different sections of the code. Most often when destructors are called gp_train_main(68648,0x1d9095ec0) malloc: Region ...
0 votes
0 answers
10 views

Can character devices be mapped to memory?

Why we can map block device files to memory but not character files? I know block devices can be mapped to memory, but character devices can't. Why is it like that? I have no idea. Maybe someone can ...
Jan Nowak's user avatar
-2 votes
0 answers
134 views

How does CPU->GPU memory copying work in details?

I'm new to high-performance computing and GPU usage. I want to understand how to estimate the computation time on a GPU. Now I am trying to understand how memory copying between host and device works....
kekmek's user avatar
  • 1
0 votes
1 answer
20 views

Snakemake, slurm and memory

I am struggling to understand how snakemake submits jobs to slurm. When I have a basic slurm sbatch script I usually add a line, such as #SBATCH --mem=5G to determine that slurm may use 5 gigabytes (...
Laura's user avatar
  • 3
0 votes
0 answers
23 views

Total Memory size at launch of an asp .dotnet core web-application

I have created a web application and functionally it's working fine (both in Dev as well as in Production). However, what I am confused about is the amount of memory (private byte) allocated at the ...
somnath's user avatar
  • 19
0 votes
0 answers
31 views

Does JS (chrome) string interning on object/maps merging?

Given we have 2 objects as follows: let obj1 = { "ac": 1, "com.ac": 1, "edu.ac": 1, "gov.ac": 1, "net.ac": 1, "mil.ac": 1, &...
4ntoine's user avatar
  • 20k
0 votes
0 answers
41 views

Is there a way to Optimizing Linear Memory Model in WebAssembly for Improved Memory Management?

We've been exploring challenges the flat memory model in WebAssembly, as highlighted in Empowering Web Applications with WebAssembly: Are We There Yet?: https://weihang-wang.github.io/papers/wasm-...
Faizal Abdul Hakim's user avatar
0 votes
1 answer
38 views

What would be optimal thresholds for JVM Heap Memory alerts in DataDog?

I'm working on creating Datadog alerts to alert teams when their services are on a certain percentage of JVM Heap Memory. However, I have a hard time figuring out what thresholds would be somewhat ...
N3ur0's user avatar
  • 47
1 vote
1 answer
83 views

CAN access elements of 0-length vector. Why? [duplicate]

I don't understand why the C++ code below works. In this program the user specifies size of array and the array itself, then the program prints length of the array and it's elements. I use reserve() ...
fetis's user avatar
  • 33
1 vote
1 answer
55 views

Is using StringBuilder in place of String within function parameters a good idea? [closed]

I need some suggestion on using StringBuilder as against String inside function parameters. The basic structure of my program is as below : There are several functions running sequentially . Based on ...
somnath's user avatar
  • 19
0 votes
1 answer
55 views

C++ character pointer string allocated with malloc contains gibberish when printed

As far as I can tell, I'm using malloc correctly to allocate a string as a character pointer. char* test = (char*) malloc (sizeof (char) * 4); test[0] = 't'; test[1] = 'e'; test[2] = 's'; ...
Nightmare Games's user avatar
0 votes
0 answers
61 views

Golang heap profile and runtime.Memstats show different result

here is my runtime.Memstats, it shows my HeapInuse is about 14.76GB # Alloc =15850481912 # TotalAlloc = 14112784178272 # SyS =27469378624 # Lookups =0 # Mallocs = 220246619671 # Frees = 220208758959 # ...
Jacky Zhao's user avatar
0 votes
0 answers
33 views

stopping a function from taking 100% of ram

I am making an app that has encryption with PyCryptodome, here is the code that does the encryption: class Cipher: def __init__(self, password: str, key: bytes = None): self.key = PBKDF2(...
user21815993's user avatar
0 votes
0 answers
23 views

.Net stuttering while freeing up memory

I'm working on a DirectX 12 based app in c# with .Net Framework 4.8, which interface to DirectX using a c++/cli project. Regardless of the context, I'm noticing heavy stuttering (the app freeze for ...
Michele M.'s user avatar
0 votes
0 answers
15 views

How to map bar memory address to user mode virtual address on Linux?

I want to map bar memory address(physical address) to user mode virtual address. currently, I can use mmap API to implement this function. eg. on application, call mmap API, and in driver's .mmap ...
BrisyZhang's user avatar
0 votes
0 answers
48 views

CUDA out of memory with all large language models

Everytime I try to fine-tune a model and import it into my google colab i get the following error: CUDA out of memory. Tried to allocate 4.29 GiB. GPU 0 has a total capacty of 14.75 GiB of which 2.05 ...
layla Bitar's user avatar
1 vote
1 answer
15 views

mach_vm_read returns unexpected data

unsigned char* read_memory(void *address, mach_msg_type_number_t count) { int kr = 0; kr = mach_vm_protect(mach_task_self(), (mach_vm_address_t) address, (mach_vm_size_t) count, FALSE, ...
Fauna Muirgen's user avatar
0 votes
1 answer
43 views

Share audio buffer between processes (windows)

I want to allow feedback loops in VSTHosts that do not support feedback loops, but do support custom audio routing between audio nodes. Such an example is FLStudio's Patcher. The way these audio nodes ...
GaussianWonder's user avatar
-1 votes
0 answers
37 views

Reading memory: is there always a static offset?

A static offset is a constant offset from the module base (that does not change after a game restart). I'm trying to find a static offset for a given object for a unity game using cheat engine without ...
Lou's user avatar
  • 295
2 votes
6 answers
155 views

Weird output printing arrays in C

I decided to do the CS50 course again and tried to go about solving some of the problems differently. There is a task where you have to print pyramids with two spaces between each half using the '#' ...
vaultdweller's user avatar
-3 votes
2 answers
72 views

I am running our of memory because a variable is exceeding 2^32, is there a way to fix this in javascript or a different language that avoids this?

EDIT: The error happens when mod reaches a value greater than 2^32. Is there any way to increase how many bits mod has for memory, or a better war to store them? I am running out of memory when ...
Anonymous's user avatar
1 vote
0 answers
9 views

GridDB TXN_SERVICE_START_FAILED Error: How to Check and Address Insufficient Memory?

I'm facing an issue with GridDB where I'm encountering the "TXN_SERVICE_START_FAILED" error, indicating a failure to start the transaction service. The error message suggests that memory may ...
Yousef's user avatar
  • 31
0 votes
0 answers
47 views

Record types, memorry usage and copy operations

If I define a record in C# like public record Pair(int First, int Second); and I have a loop where I do Pair x = new(1, 2); while (...) { x = new(x.First + 1, x.Second + 1); } my IDE highlights ...
huzzm's user avatar
  • 547
0 votes
0 answers
16 views

How do I represent a 32 bit binary by using 8 characters?

I'm looking at memory addresses which are 32 bits. How do I represent them using 8 digits/characters - such as '0x12345678'? How many bits does each character represent? What is this system called? ...
winterlyrock's user avatar
0 votes
0 answers
41 views

Minimum heap size in JVM (-Xms) [duplicate]

Despite setting the minimum heap size to 0 and observing successful program execution, the question arises: With the JVM's dynamic resizing capabilities, is there a compelling need for a minimum heap ...
JOTHIPRAKASH's user avatar
-2 votes
1 answer
68 views

Python retrieving data from its memory address

I currently have a very large dataset (~15 GB) which should be used by multiple python scripts at the same time. Loading single elements of the dataset takes too long, so the whole dataset has to be ...
Quasi's user avatar
  • 592
-2 votes
0 answers
24 views

Is there a way of editing Packets In the Linux Socket API? [closed]

So basically, i was going to make a wifi Deauther in C++.I was wondering if there were memory addresses in the Packet which i can edit to make into Deauth. Any suggestions or answers? So i was doing ...
Pleasedontgivemedownvotes's user avatar
0 votes
0 answers
25 views

Memory stream is empty when it posted throuh HttpPost [closed]

I get the memory stream from the BuildPackage method and send this stream through D365 Enqueue api(UploadBinaryAsync). Somehow i can see the data in D365 when i test it locally but when i deploy the ...
Ramesh Baddam's user avatar
0 votes
0 answers
22 views

msp430g2253,Register manipulation

I'm working for the first time on msp430g2253 and I was reading the headers files to understand the programming aspect of registers and one thing that I didn't understand which is the register ...
chiheb's user avatar
  • 13
0 votes
0 answers
44 views

a disproportionate amount of dead objects were detected

I made a simple example to showcase the problem. I have a blazor project with a page that call a function: <button @onclick='(() => TestMemory())'>Insert Memory</button> <h3>...
Bram's user avatar
  • 1
-1 votes
0 answers
24 views

Allocate memory with new for a variable with the type of a class that has a member vector C++

imagine you have a class like this in C++: class Class { public: int m_intNumber; std::vector<int> m_vecVector; } and now you allocate memory with new. Class* ClassVariable = ...
UncleBlobBiggestFan's user avatar
1 vote
1 answer
69 views

SALABIM how to minimize memory requirements

I am using the Salabim package in python to simulate some queueing theory. Salabim (documentation) is based on SimPy but with many extensions and additional features. Most of my problems are solved in ...
Floris Padt's user avatar
0 votes
2 answers
63 views

How immutable objects' memory cleared?

I have some questions- As string constant pool is present in the heap memory and GC collects garbage from heap memory. Does it cleans the string constant pool as well, according to my info it does ...
Aliana's user avatar
  • 29
0 votes
1 answer
10 views

Is it possible to overload the DDR controller on Zynq through PL ? An how to analyze it?

I have a Zynq7000 with softwares running on both cores. They interface with a FPGA which contains a lot of DMA. These DMA are used to perform data transfers that can go up to multiple MB. My questions ...
Lucas's user avatar
  • 65
0 votes
0 answers
39 views

there was an error loading this feature. try restarting the profiler to fix it

Android Studio is trying to use the profiler to analyse memory jitter, using Record Java/Kotlin allocations. But I was prompted there was an error loading this feature. try restarting the profiler to ...
JesseHuan's user avatar
0 votes
1 answer
22 views

active_file memory is not considered as available memory

I would like to ask your opinion about what is said in the official kubernetes documentation here. The doc states "The kubelet treats active_file memory areas as not reclaimable" but by ...
Gamby's user avatar
  • 585

1
2 3 4 5
721