Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [memory-usage]

Filter by
Sorted by
Tagged with
16 votes
6 answers
10k views

So, the problem: When I run the same C++ code in Visual Studio, with the same input and parameters, I get either the correct output, or an output that is completely messed up (99% of values go to zero)...
babipsylon's user avatar
1 vote
0 answers
459 views

I am writing a compiler in C++ 20. I am looking for ways to improve heap memory performance. For example, I can compile a 36.8 MB source file that is just many repeating lines of: let x0: string = &...
Wesley Jones's user avatar
6 votes
2 answers
2k views

As mentioned in some StackOverflow posts (like this one), I'm dealing with a difficult situation: My company is developing some C# applications (being a client-server application). We have migrated ...
Dominique's user avatar
  • 1,844
0 votes
3 answers
175 views

Consider Mastodon as an example - basically open source Twitter. Tweets can be up to 500 characters long. Of course, since it's open source, you can modify it to allow longer tweets. Unmodified ...
Stack Exchange Broke The Law's user avatar
-1 votes
1 answer
242 views

I'm trying to build a simple compiler for a subset of the C language in C. To achieve this, I needed to figure out a way to represent the grammar symbols. Basically, each symbol can either be a "...
Mehdi Charife's user avatar
1 vote
4 answers
3k views

I want to make sure I understand the concept referred to by alignment: Is it just a way of making sure that you never have a non-integer number of words? The wikipedia page says in order for an access ...
Hello's user avatar
  • 19
3 votes
1 answer
104 views

I have a memory pool class that manages memory objects of fixed sizes, a bit like a primitive malloc() that can only return memory blocks of a few predefined sizes and unlike malloc() is guaranteed to ...
Mecki's user avatar
  • 2,390
-2 votes
1 answer
587 views

I have following code snippet void func(int row,int n,std::vector<int>& buffer){ if(row>n){ return; } std::vector<int> new_buffer; for(int elm : buffer){ ...
ShayakSarkar's user avatar
8 votes
1 answer
702 views

So I'm aware there's some degree of timing-based logic in existing programming languages, like threads and the sleep() function (and derivatives thereof), as well as events / delegates. However, I was ...
Emerald47890's user avatar
-2 votes
1 answer
130 views

You must have seen them as applications on mobile devices and I've been using one on mac OS. I was wondering what exactly memory cleaner software do? Do they free up memory in both ROM and RAM? And ...
Nojan's user avatar
  • 107
-4 votes
1 answer
106 views

I am reading some data from USB, do some packet processing and then send the result to the Ethernet port. The USB ports are connected to an onboard USB Hub where it communicates with the ...
Kurtul's user avatar
  • 93
3 votes
7 answers
3k views

For example I have a static C++ array {'d', 'o', 'c', 's'}. And I have x86 architecture, with 32-bits length words. I want to replace letter c with g. As far as I understand, when we make a read ...
No Name QA's user avatar
1 vote
2 answers
397 views

I have been coding some octave .oct files lately (C++), and for my purposes speed is of the essence. It seems to me that creating C++ objects (in general) can take some time. I was wondering if ...
mathreadler's user avatar
-3 votes
1 answer
410 views

Are there other general purpose programming languages besides Objective-C +ARC and Swift which target the llvm and use static compile time Automatic Reference Counting for memory management?
v217's user avatar
  • 95
-2 votes
1 answer
1k views

I have a large hash, around 6 gigabytes that I load into memory. On my current laptop that I develop from, it really does a number on my system, causing massive amounts of lag while I try to go about ...
Anon's user avatar
  • 3,649
-2 votes
1 answer
181 views

This is a general question but with a specific use case. There is only a single and completely unaffordable profiler for the Xamarin framework. So this makes me wonder if there are some programming ...
Den's user avatar
  • 4,887
1 vote
1 answer
188 views

Despite various ways to scrub sensitive data in volatile memory (see Survive DSE or Zeroing buffers), programs tend to perform transparent memory copies (such as a Garbage Collection). The newly ...
weir007's user avatar
  • 37
0 votes
1 answer
185 views

Say I have total RAM memory of 1GB , HD of 10 GB with 250 MB swap space Say I have two files(f1 and f2) each of 500 MB opened on my my laptop. Now both files are in memory and have consumed 1 GB of ...
user3198603's user avatar
  • 1,896
2 votes
2 answers
576 views

Does it optimize a program in java to declare methods private wherever they can be private or it doesn't change a thing and it's just a question of encapsulation? I was asking myself if declaring a ...
Otix avi's user avatar
5 votes
1 answer
1k views

I'm developing a single page application where the first page contains the subjects and the next one contains items of the chosen subjects. The items are stored in a JSON object fetched from the ...
sir-haver's user avatar
  • 179
-4 votes
2 answers
2k views

In C program I'm doing below stuff int x = 4; Let us assume integer has 2 bytes in this case. So my question here is the variable x will hold two bytes that mean 16 bits. So here how the value 4 ...
Abdulvakaf K's user avatar
4 votes
2 answers
239 views

When a system is running low on available memory can it ask programs in general to give up any non-vital memory without shutting down. Like a process signal which causes the processes to yield any ...
Allahjane's user avatar
  • 195
0 votes
1 answer
212 views

Haskell is one of the few non-strict languages out there. In his paper Why Functional Programming Matters, John Hughes uses (memoized) lazy evaluation (as well as higher-order functions) to implement ...
Qqwy's user avatar
  • 4,947
109 votes
15 answers
20k views

I recently interviewed at Amazon. During a coding session, the interviewer asked why I declared a variable in a method. I explained my process and he challenged me to solve the same problem with fewer ...
Corey P's user avatar
  • 1,214
-1 votes
1 answer
223 views

Is it possible to create an algorithm that will execute at the same rate and speed on faster and slow computers. What i mean is, i have a year 2000 desktop that can run a certain computational ...
McKabue's user avatar
  • 107
2 votes
2 answers
1k views

In my MVC 5 web application there are many instances in which users will require to view thousands of records within grids, now I managed to get around many performance related issues by utilising the ...
Abs's user avatar
  • 53
5 votes
1 answer
7k views

Why do we need to specify the type of the data whose address, a pointer will hold, if all pointers are the same. Since all pointers store addresses. Also, the amount of space a pointer will require in ...
amd's user avatar
  • 59
0 votes
1 answer
459 views

Is there a memory penalty to passing around large objects (like an entire http request, or the blob contents of an uploaded file) between functions within the same (Erlang) process? It is my ...
ahron's user avatar
  • 165
-5 votes
1 answer
200 views

I see an interview question thats goes like this: Assuming you have an array with numbers 1 to N. Where N is at most 32,000. This array may have duplicates and you do not know what N is. With, 4KB ...
Eugene Lim's user avatar
0 votes
1 answer
64 views

If data structures such as trees and certain sorts(quick sort, merge sort) work using recursive algorithms and recursive algorithms take up a lot of memory space in the stack and can only work on a ...
Angel's user avatar
  • 21
-1 votes
1 answer
158 views

Right now I am collecting memory information on a node.js server every 100 seconds. I want do display the memory usage info as a graph on the front end. const mem = { heapTotals: [], heapUseds: []...
user avatar
0 votes
3 answers
1k views

A system that sometimes will need to use a pretrained machine learning model. That model is about 10Gb on disk, and when loaded uses about 10Gb of RAM. Loading it from disk takes a nontrivial amount ...
Frames Catherine White's user avatar
7 votes
6 answers
4k views

I am doing C++ programming in Ubuntu and really care about the efficiency of my code. The computer that I work with has 32 GB of RAM and the compilation is done with the C++11 option. I noticed that ...
If_You_Say_So's user avatar
7 votes
3 answers
2k views

I have a hypothetical C++ code containing these two classes: Master: it's big, does a lot of things and is meant to have only one instance; Slave: quite the opposite. It can also do a lot of things, ...
Milack27's user avatar
  • 181
1 vote
0 answers
489 views

I have the following abstract class which implements the "Allocator" concept, using policies and traits to customize behavior: #define FORWARD_ALLOCATOR_TRAITS(C) \ typedef ...
MattyZ's user avatar
  • 113
1 vote
1 answer
249 views

What is the exact definition of a memory address space? Is it correct to name the set of all the numbers from 0 to the highest addressable byte the definition of an address space? EDIT: I would like ...
yoyo_fun's user avatar
  • 2,297
0 votes
3 answers
734 views

I would like to use garbage collection several times after calling some external dlls. And I wonder how often can I do this, without causing problems to my application. I'm using the following codes ...
C. Chancellor's user avatar
3 votes
3 answers
2k views

I am talking about single thread general purpose memory allocation/deallocation from a global 'heap' as e.g. every C programmer knows in the form of malloc()/free(). I can't recite the actual title ...
Vroomfondel's user avatar
-1 votes
1 answer
2k views

I have written two small programs in which I declare a very small array. Then I try to access values out of bounds. The interesting thing I noticed that when I try to decrement the index I can ...
yoyo_fun's user avatar
  • 2,297
3 votes
2 answers
420 views

I have an ASP.NET web site on a shared server. The site is mainly used to house some WCF services that are used by a desktop application. We had a problem in that the server stopped responding, and ...
Avrohom Yisroel's user avatar
1 vote
0 answers
443 views

In my current Java EE project I've got a quite common task: Load objects from database using Hibernate, transfer them in another object structure (based on a XSD) and serialize it using JAXB. To ...
bish's user avatar
  • 173
5 votes
0 answers
1k views

What are some best practices for writing memory-efficient (for the lowest peak memory usage) CSS? I realize this is a broad question, so I have broken it down into two main categories: What are 'do's ...
Jack G's user avatar
  • 242
3 votes
2 answers
444 views

I am developing a safety critical embedded system and I am programming in C. We have a set of const structure declared in memory and they hold some critical data. I want to make sure that any of ...
Swanand's user avatar
  • 133
1 vote
2 answers
603 views

I need to store two 32-bit numbers in a way that is quickly accessible and as storage space efficient as possible. My keys are a combination of the following two values: port: 0 - 29 vlan: 1 - 4095 ...
stdcerr's user avatar
  • 139
2 votes
1 answer
1k views

I am building a JavaScript application that makes AJAX requests to a PHP API Back-end to load JSON data for different views. The app UI consist mainly of a left sidebar menu which has items loaded ...
JasonDavis's user avatar
1 vote
1 answer
143 views

In a PHP CLI software, we are facing serious memory leakage due to a lot of rotten code, both accumulated in our own software and third-party plugins for our software. Currently, the object ...
SOFe's user avatar
  • 728
2 votes
4 answers
14k views

I recently reviewed some C++ code written by a fellow student, and he did something I wouldn't think is necessary. In main(), he creates a class object on the heap with the new operator. Then he ...
CMDoolittle's user avatar
3 votes
0 answers
111 views

I am implementing a certain algorithm that works like this: Create a closed contour (list) of elements in a matrix, where closed means that the last element is adjacent (by row, column) to the first. ...
bright-star's user avatar
2 votes
1 answer
124 views

I have a function to generate n random string with the same length, making sure there isn't any duplicates, and then saves them to the database. Right now, to speed things up, first I get all the ...
Oscar Yuandinata's user avatar
0 votes
1 answer
2k views

How'd I go about copying a function in memory to a different location and be able to run it from the new location in C++? I thought maybe memcmp would work, but I'm not sure how I'd go about running ...
Adam Smith's user avatar