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.

memory
Filter by
Sorted by
Tagged with
0 votes
0 answers
149 views

Representing unmanaged memory

I have a simple class that wraps around some unmanaged memory, like this: public class Wrapper<T> { private unsafe T* _ptr; private int _length; public int Length => _length; ...
Win32ApiUSer's user avatar
0 votes
1 answer
1k views

How to use variables from callback in Python-Plotly-Dash layout?

I want to draw my Dash layout with a dynamic number of components (NumericInputs in particular). Everything goes fine when this number is static, I can change the values with a callback and everything....
Alonso's user avatar
  • 51
0 votes
3 answers
80 views

How do bytes and addresses correlate in C?

I have seen that there are many questions related to this topic, but I could not infer an answer, so I decided to ask my first question here on stack overflow. Currently, my question is regarding the ...
JackSen's user avatar
2 votes
1 answer
2k views

Memory usage of downloading files using Fetch API + Blob API

I am downloading a large number of files using the following method and I am concerned about its memory usage. Chrome's Blob Storage System Design documentation mentions the following. If the in-...
Zhang Chandra's user avatar
1 vote
1 answer
716 views

Python: MemoryError (scripts runs sometimes)

I have a script which sometimes runs successfully, providing the desired output, but when rerun moments later it provides the following error: numpy.core._exceptions.MemoryError: Unable to allocate 70....
neòinean's user avatar
-2 votes
1 answer
35 views

I got a memory error and i dont know whats cauising it in c++ [closed]

Hello this code is part of a big code and it causing a lot of problem i dont know why. i tried to use structer and vectors its ggot an error about vector out of range then i switched to class but ...
Zelda Scarlet's user avatar
1 vote
0 answers
53 views

Why does my O(1) space code use up more memory than my O(logN) space code, provided there are no large constants in the O(1) expression?

I am currently brushing up on my Java skills, and am confused about how some of the code I have written is executing on a low level. This is for a Leetcode question called "Deepest Leaves Sum&...
AaronC's user avatar
  • 693
0 votes
1 answer
112 views

Bit vs Byte in memory adress?

I know that 1 byte = 8 bits. Can I access 1 bits in memory or it should be a full byte? Let's suppose the memory starts at: 0x0000 then what's the next position? 0x0001 or 0x0008?
user avatar
0 votes
0 answers
29 views

How to free resources in JavaScript?

I have a web page which continuously fetches base64 images from server and set it as source to image now i can see in dev tab that the resources memory is increasing 58.1 MB / 58.1 MB resources Finish:...
Jaysmito Mukherjee's user avatar
0 votes
1 answer
405 views

Creating cv::Ptr cause an exception at the end of the application

I am working with openCV arUco markers to detect some markers. So I generated pre-defined dictionary and saved it in a file. However the aruco::detectMarkers can only get Ptr<aruco::Dictionary>. ...
Yonatan's user avatar
  • 51
1 vote
0 answers
80 views

Is there a way to automatically allocated structs on the heap?

I'm working with an ESP-WROOM32D under VSCode with PlatformIO that uses the default xtensa32 toolchain. My current project involves porting a library to this architecture and the source files in C ...
OBones's user avatar
  • 320
3 votes
1 answer
325 views

Ignore response body in Gatling

As part of a load test in Gatling, I download a huge file (about 4GB). When doing so, I can observe the memory usage of Gatling gradually increase, until it hits 2GB, when it stops the download until ...
MetaColon's user avatar
  • 2,935
0 votes
2 answers
340 views

Memory leak with function getline. (Still reachable)

Here's my piece of code(the purpose is to read line and make a structure out of it): typedef struct{ size_t length; char *letters; }line; static line ReadLine(){ char *buffor = NULL; ...
Yashiru99's user avatar
0 votes
1 answer
368 views

React Native : FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory in React

I got this problem in my project. I have already searched all solutions available online but can't find anything that can solve my issue.. <--- Last few GCs ---> [1884:0x105805200] 415338 ms: ...
Haz Issac's user avatar
0 votes
1 answer
298 views

Equivalent of mmap with MAP_GROWSDOWN in Windows

In Linux, I could use mmap with the MAP_GROWSDOWN flag to allocate memory for an automatically-growing stack. To quote the manpage, MAP_GROWSDOWN This flag is used for stacks. It ...
Marco Merlini's user avatar
0 votes
1 answer
451 views

GRUB memory map gives me weird values

I am trying to use grub in order to get the memory map, instead of going through the bios route. The problem is that grub seems to be giving me very weird values for some reason. Can anyone help with ...
user avatar
0 votes
1 answer
424 views

How are Virtual Bytes allocated?

At the start of a Windows user-mode process, what determines the initial size of its Virtual Address Space? What makes Virtual Bytes fluctuate during the lifetime of a process? As per Microsoft docs:...
Sergey Slepov's user avatar
1 vote
2 answers
211 views

Should a local variable be introduced for an array element at a specific index which is accessed repeatedly?

If an array element at a specific index is accessed repeatedly in a loop, should a local variable be introduced, in sense of performance ? Aka. does the array access by index bring overhead? e.g ...
Eric's user avatar
  • 23.5k
0 votes
0 answers
33 views

Does GCHandle.Alloc prevent paging?

Suppose you do this: byte[] arr = null; GCHandle handle; try { arr = new byte[1024]; handle = GCHandle.Alloc(arr, GCHandleType.Pinned); // Do something with arr } finally { if (...
Win32ApiUSer's user avatar
5 votes
1 answer
1k views

In-place RGB->BGR color conversion is slower in OpenCV

Is it the case that the in-place RGB->BGR color conversion routine in OpenCV saves some memory, but takes longer? If yes, can anyone explain why? My application calls the cv::cvtColor(srcMat, ...
Fijoy Vadakkumpadan's user avatar
0 votes
0 answers
147 views

Can GC copy byte arrays?

I have a function which generates a random key, like this: internal static char[] GenerateKey(int size) { byte[] bytes = null; try { bytes = new byte[size]; char[] result = ...
Win32ApiUSer's user avatar
0 votes
1 answer
34 views

How to create and use two Python iterables of shared memory items, and maintain the shared memory during usage?

How can I create a pair of iterables containing the same items (not just copies, but shared memory of items) but in different order, and such that a change to an item in one of the iterables will be ...
mattroos's user avatar
  • 125
1 vote
1 answer
292 views

Get class name based on address of its instance in another process

I'm looking for anything that can help me deviate string GetRTTIClassName(IntPtr ProcessHandle, IntPtr StructAddress). The function would use another (third-party) app's process handle to get names of ...
TheLeftExit's user avatar
-2 votes
1 answer
80 views

Questions about cells memory [closed]

I am a beginner and I have 1 question like this: example: int a = 10; now I have to write a program to print the value of the 2nd byte. Thank you very much for your help!
Đức Nam Nguyễn's user avatar
1 vote
1 answer
325 views

Linux memory map between smaps and gcore process dump

I was inspecting high memory usage by a process. I got the process address consuming high memory with - sudo less /proc/12345/smaps I got this segment which had high memory utilization - 5555573e8000-...
krackoder's user avatar
  • 2,931
11 votes
1 answer
20k views

DefaultCPUAllocator: not enough memory: you tried to allocate 364742208 bytes. Buy new RAM

I am running a pytorch NLP model in python and I keep encountering the following strange error: RuntimeError: [enforce fail at ..\c10\core\CPUAllocator.cpp:75] data. DefaultCPUAllocator: not enough ...
R_Sengupta's user avatar
0 votes
0 answers
76 views

few question related to nodejs memory useage and garbage collection

I have few questions related to memory usage in nodejs In the MVC project structure, can require file increase memory uses over time? eg : In server.js (main file i.e entry point of server) let user =...
bipin's user avatar
  • 419
1 vote
0 answers
993 views

Vulkan Memory Allocator Implementation Errors after #define VMA_IMPLEMENTATION

Windows 10, Visual Studio Community 2019 I am following https://vkguide.dev/docs/chapter-3/triangle_mesh_code/ and it mentions to add #include "vk_mem_alloc.h" and if you compile you will ...
jadedx's user avatar
  • 11
0 votes
1 answer
1k views

How to read/write to specific memory addresses in SD cards with C++ in Debian?

I am working on an embedded application running Debian GNU/Linux 10 (buster) and I want to have direct access (i.e. read and write) to the content available at specific memory addresses in an SD Card. ...
tuscasp's user avatar
  • 49
1 vote
2 answers
2k views

How to set max locked memory in a pod running as non root

Previously my kubernetes pod was running as root and I was running ulimit -l <MLOCK_AMOUNT> in its startup script before starting its main program in foreground. However, I can no more run my ...
Fabrice Jammes's user avatar
4 votes
0 answers
2k views

QEMU Memory Allocation Issue

I seem to have encountered an issue with qemu memory allocation. static void * x64_syscall_mmap(void *base_addr, u64 size, u32 memory_protection, u32 mapping_visibility, s32 fd, u64 ...
Edward Chamberlain's user avatar
0 votes
1 answer
189 views

Does an Operating System check every Instruction?

Not sure if anyone here can answer this. I've learned that an Operating System checks if an instruction of a program changes something outside of its allocated memory, and if it does then the OS won't ...
b0red's user avatar
  • 13
0 votes
0 answers
30 views

Assume a system has infinite amount of main memory, then is virtual memory still needed?

We have an arbitrarily large amount of main memory. Why do we still need virtual memory then, since there is no need to create the appearance of 'more memory than is available physically', since we ...
Chonkie Mongol's user avatar
2 votes
2 answers
1k views

Java ImageIO read image byte[] into pre-allocated BufferedImage

I'm working with ImageIO and JAI and want to read a byte array into a BufferedImage. The byte[] contains data for a JP2000 encoded image, and it's fairly large, around 100MB. I'm currently doing ...
billschmidt626's user avatar
-1 votes
1 answer
753 views

C# Out of Memory while handling and encrypting large files

Im trying to encrypt a large file (Camtasia.exe) with the AES encryption. Now for some reason I get a "Out of Memory" Exception. Im really new to this and I don't know how I could possibly ...
Elvis Detters's user avatar
2 votes
1 answer
685 views

dotMemory command line scheduled snapshots

I'm running dotMemory command line against an IoT Windows Forms application which requires many hours of tests on a custom appliance. My purpose is to get memory snapshots on a time basis, while the ...
José Luiz Arantes's user avatar
1 vote
0 answers
345 views

Python code to create password protected zip in-memory for HttpResponse

I would like to generate a password-protected Zip file for my csv data in memory and return to webpage via Django HttpResponse. So far I can generate plain zip file to HttpResponse as follows: from ...
yhd.leung's user avatar
  • 1,342
0 votes
1 answer
462 views

I'm trying to find a better way to find nth most rare element in array

Say, elements=5, 4, 2, 2, 1, 5, 4, 3, 3, 4, 4, 3, 5, 5, 5 return elements.GroupBy(x=>x).OrderBy(x=>x.Count()).Skip(n-1).FirstOrDefault().Key; For a larger array, the memory limit is ...
Vidya Dayanidhi's user avatar
0 votes
0 answers
211 views

IMemoryCache removes old data when new data is set?

I'd like to be able to cache a List of products. And if I get a new List of products, which contains new products, I'd like to add them to the cached products. And if the new list of products also ...
jrwebbie's user avatar
1 vote
3 answers
977 views

Java Heap Memory Allocation for multiple applications in Single Server

We have a Linux server with 32 GB RAM. So the Default Heap size allocated in the server is 1/4th which is 8 GB. java -XX:+PrintFlagsFinal -version | grep HeapSize Now, we have 3 java processes running ...
Roopashree's user avatar
1 vote
2 answers
839 views

Windows Command Processor Memory Usage continuously increasing problem. (Batch File)

I have a batch file here below @echo off :count set /p output=<time.txt :start timeout /t 2 set /a out=%output%+2 :cut echo %out% > time.txt (call :code%out%)>nul 2>&1 if ...
Eliazar's user avatar
  • 371
0 votes
1 answer
387 views

Use `ctypes.string_at` to check the memory of a `memoryview` object

In Python, memoryview gets a viewer for internal memories of bytes, bytearrays or whatever supports buffer protocal. If I use ctypes.string_at to get the value at the memory address shown by a ...
Hou Lu's user avatar
  • 3,142
-1 votes
1 answer
68 views

How to have my Visual Studio running without debugging program keep expanding RAM usage till RAM is full and even then use SSD as "RAM"?

I got an "Out of memory exception" and my 32 GB RAM isn't even full, it's downloading pictures, I want it to keep downloading and expanding RAM usage at night and even use the SSD as ...
John1990's user avatar
1 vote
0 answers
21 views

What are the constraints on the value returned by `id()`

The doc only has this to say: Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-...
Gulzar's user avatar
  • 26k
0 votes
1 answer
88 views

What is the difference between vector<vector<int> > v and vector <int>* v in memory allocation?

I use these two types of two-dimensional vector to load a graph. In the first case I use vector<vector<int> > v to load the graph adjacency matrix, and in the second case I use vector <...
Aesopd's user avatar
  • 3
1 vote
0 answers
141 views

Fatal error: Allowed memory size of 262144000 bytes exhausted (tried to allocate 1879048224 bytes) in /home/xbt/Client/htdocs/common.php on line 20

Please could someone be so kind and help me with an error I'm getting. Before I explain I looked at the similar question but unfortunately it didn't help. Anyways I tried to increase PHP Maximum ...
Left is Best's user avatar
-1 votes
1 answer
56 views

Freeing a tree structure in C

I'm using a tree of structs in my C program, where the struct is set up like so: typedef struct SymbolTable_t { int id; Symbol symbols[size]; int count; struct SymbolTable_t * parent; ...
James Mclaughlin's user avatar
0 votes
1 answer
64 views

memory limit exceeded while using comparator function

#include<bits/stdc++.h> using namespace std; bool compaa(int i,int j) { if((i%2)!=0) return true; else return false; } int main() { int t; cin >> t; while (t--) { ...
HARSH JAIN's user avatar
1 vote
1 answer
472 views

How to free memory allocated in a function without returning its pointer?

I have a function like this: int fun(){ int* arr = new int[10]; for(int i = 0; i < 10; i++){ arr[i] = 5; } delete[] arr; // return arr[6]; } int main(){ std::cout ...
user0xfa81cc92's user avatar
0 votes
0 answers
383 views

MIPS program not printing string

Working code Following is a simple program which prints Hello guys: .data myMessage: .asciiz "Hello guys\n" .text li $v0, 4 la $a0, myMessage syscall Output: pam@g3:~/fuzzy-robot$ java -...
Anupam's user avatar
  • 468

1
82 83
84
85 86
726