Most voted "memory" questions
This tag is to be used with memory problems in programming. DO NOT use the tag for memory installation problems or any non-programming related subject. If the problem is memory management have a tag just for this.
Learn more…332 questions
Sort by count of
-
8
votes2
answers168
viewsWhat makes an object eligible to be allocated in the stack?
Article link: http://www.vogella.com/tutorials/JavaPerformance/article.html#Escape%20Analysis "The Programming language(Java) does not Offer the possibility to Let the Programmer decides if an…
-
8
votes2
answers1802
views -
8
votes3
answers3514
viewsHow to store any string in C?
How do I store a string (input) without knowing the size of this string, for example: #include<stdio.h> int main (){ char nome[]; /* a array não tem tamanho determinado porque o input ainda…
-
8
votes1
answer93
viewsDoes Java misjudge memory usage values or is there something wrong with the algorithm?
I was studying GC and the doubt arose when I ran it below: public class Garbage { public static long carregarMemoria() { List<Integer> list = new ArrayList<>(); for (int i = 0; i <…
-
8
votes2
answers941
viewsImport multiple classes from the same package
I wonder if there’s any significant difference in making import java.util.* instead of import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; import…
-
8
votes2
answers300
viewsWhy does . NET’s Garbage ollector have several generations?
I understand why there is a Garbage Collector, but I wanted to know the advantages of making it have several generations. It seems something much more complicated, it needs to be very advantageous.…
-
8
votes1
answer122
views -
8
votes1
answer127
viewsStatic members are collected by GC when no longer needed?
In a class that has a static variable, it exists throughout the application. The linked object is collected at some point? Example: public class Exemplo { private static List<int> lista = new…
-
8
votes1
answer178
viewsPython 64 bits have advantage?
What is the advantage of using 64-bit Python over 32-bit Python? It would be performance?
-
7
votes4
answers379
viewsWhat types of retain Cycles can be generated with ARC?
I know that with ARC there can be Leaks in iOS. What are the most frequent Leaks types and how they can be avoided?
-
7
votes1
answer767
viewsChange of char variable content
I’m having trouble working with files and handling char. CODE char *fileTipoDespesaDefault; char *fileTipoPagamentoDefault; FILE *fileTipoDespesa; FILE *fileTipoPagamento; /** * tipos : 1 =>…
-
7
votes1
answer82
viewsIs it possible to know at what point the script reaches the memory peak?
It is possible to know at what point the script reaches the memory peak? I have a PHP script that at the end shows this result: Usage: 380.515625Kb Peak: 393.5859375Kb Real: 512kb Example: <?php…
-
7
votes2
answers1375
viewsWhat’s the difference between On heap and Off Heap in Java - JVM Memory
I would like an explanation determining the characteristics of On heap and Off heap Memory in Java. We know that Thread Stacks, the code of our application and the Buffers NIO are all allocated Off…
-
7
votes1
answer598
viewsIs it correct to return a memory address in function?
I was asked to design a function that was called, open a file. txt and return the pointer of this file, ie return a memory address. However as I know memory is only temporarily allocated for…
-
7
votes1
answer143
viewsMemory addresses
My architecture is 32 bits so my memory addresses are 32 bits? because I was using a debug seeing some codes Assembly and arrived in a part where had a loop , and he was picking up byte by byte of a…
-
7
votes3
answers972
views -
7
votes2
answers1833
viewsError: Object of type 'float' has on Len
I was thrashing simple operations on the Python interpreter, and the following command made me curious: >>> b = 3.12; len(b) With the following error: Traceback (Most recent call last):…
-
7
votes1
answer566
viewsDynamic Memory Allocation X vector
I was studying this subject in C, and in most of the places I look for, one of the examples of using this resource is when you’re going to create a vector whose size you don’t know. Example: int…
-
7
votes1
answer352
viewsHow to allocate an immense amount of memory?
I created an Onfly encryption algorithm that encrypts bytes without the need to copy them to a new copy of those same bytes. This is both to encrypt and to decrypt these byte lists. As in the scheme…
-
6
votes2
answers830
viewsHow to allocate program memory and storage before running my application in Wince?
I am reprogramming a C# application to run on Windows CE, but my machine has little memory. Therefore, I need to allocate the appropriate amount of processing memory (program memory) and storage…
-
6
votes1
answer1195
viewsWhy does ob_get_clean wipe memory without starting the buffer with ob_start()?
I was one day doing some tests, analyzing how functions influence memory usage, and, by chance, called the function ob_get_clean(). I noticed that the function call "decreased" the memory size used…
-
6
votes1
answer1924
viewsMessage "Could not reserve enough space for Object heap" in JVM
So I wanted to know the limitation for memory allocation to the JVM depending on the operating system and processor architecture. If, as you set it, you lower the maximum value of the perm-size to a…
-
6
votes2
answers2673
viewsHow big is a memory address?
What size of a memory address? I think a memory address has 32 bits, but I’m seeing it in a Debugger one int, where he separated 4 addresses for him. So, an address is equal to 32 bits? Because…
-
6
votes2
answers403
viewsComputer buffer
I’ve read several places about buffers and there they say that it is a place in memory to store temporary values so they give an example like in C: char exemplo[10]; and say that this is a buffer,…
-
6
votes1
answer217
viewsWhat is behind the malloc() dynamic allocation function?
What mechanisms the function malloc() uses in practice to manage dynamic memory allocation in a program?
-
6
votes2
answers1271
viewsDoes the memory consumption of a variable increase each time it is used?
I have been trying to understand more about the memory consumption of the created variables. And I even did some tests here on my computer with variables! I then created some variables and used it…
-
6
votes1
answer2424
viewsFree up memory in C++
I am obliged to release memory of every variable that I will no longer be using? If yes, how to do?
-
6
votes1
answer80
viewsHow long is the data allocated to functions?
In one language, (I don’t know if there’s any difference in others, but you can consider Javascript) when I have this situation: function a() { b(); } function b() { c(); } function c() { d(); }…
-
6
votes1
answer1263
viewsHow to avoid buffer overflow in C/C++
The program below allows the occurrence of memory overflow, as it is possible to overwrite the variable zero, placing a value "large" in the variable buffer. How to make a safe program by avoiding…
-
6
votes1
answer2200
viewsWhat is the maximum amount an array can support in PHP?
In PHP I often work a lot with frameworks. Generally, they bring the results of the query to a database in a array. In some cases, when the number of data from a table or a relationship reaches a…
-
6
votes3
answers2361
viewsHigh consumption of RAM
My Visual Studio 2015 when I use to debug a WEB C# MVC project has the following RAM consumption: Is this consumption normal? My computer gets very slow when I have to test some modification on a…
-
6
votes2
answers720
viewsCan memory leak occur in Java?
In the C language, for example, memory leaks are common because the responsibility for shifting memory lies with the programmer. In the example below (taken from Wikipedia) we can see a classic…
-
6
votes1
answer708
viewsIn R, when does a vector become "Too long"?
When trying to create an infinite vector (1:Inf) I received the following message: Error in 1:Inf : result would be Too long a vector However, when the vector does not know in memory the message is…
-
6
votes2
answers665
viewsWhat is the maximum size of an object in 32 and 64 bits?
Specifically the array can have up to 4 billion elements, I think, and the most common sizes of elements should be 4, 8 or 16 bytes. I ask, what is the maximum size that the object can occupy in…
-
6
votes1
answer83
viewsIs there any way to be notified that there will be a garbage pickup?
I’m studying about the Garbage Collector do . NET and wanted to know if there are any events that I can sign and be aware whenever a collection will be made.
-
6
votes1
answer81
viewsJava type relationship or other language with processor architecture
Java has the primitive types: int and float, that store at most 32 bits of information, and we also have the types long and double that store 64 bits of information. Does this have or might have…
-
6
votes1
answer230
viewsIn R, a function that reads only a few columns of a dataframe in Rda format
I have 27 txt files. Each file represents a state of brazil. In fact, each file is dataframe on labor market. The 27 files can add up to more than 20 gigs. The first thing I did to reduce this was…
-
6
votes1
answer196
viewsWhat is the difference between performance between different types of string concatenation?
I know 4 different types of concatenation of string in the c#: // string Interpolation $"valor {variavel} R$"; // Verbating string @"texto qualquer pula a linha e continua o texto"; // concatenar 2…
-
6
votes2
answers112
viewsWhen is an Slice data copied?
When I do so: a = [ 1, 2, 3] b = a[1:] b use the same list of a or it creates another list and copies the data that is pertinent? If you have many items it will slow down? Happens even if I don’t…
-
6
votes1
answer219
viewsHow does the . NET "using" and Garbage interface work?
In a reply now deleted here on the site it seems that there was some confusion with the content indicating the use of GC.Collect() and how the using C# works. So how does it actually work using and…
-
6
votes1
answer71
viewsRecursive Problems - Too Much Memory - Angular 9 - Settimeout()
Guys, I’m building an API and I need to make requests every three seconds on the server. Follows the code: countAcess() { if (this.menuExa && this.appService.requestValid()) {…
-
6
votes2
answers273
viewsWhy does pointing to the same memory address change an object?
If I run the following code: let a = [1, 2, 3] let b = a In this case, the variable 'a' and 'b' are pointing to the same memory address, consequently, everything I change to 'a' will theoretically…
-
6
votes1
answer79
viewsWhat is the difference between the function "malloc()" and a created variable?
I was reading some codes in C and I realized that to generate some specific object is used the function malloc(). It is not easier to create this object in a variable than to use the malloc()? Here…
-
5
votes4
answers556
viewsWhat is the fastest, most memory-saving type?
I am making a game of navinha in C, and therefore need to put in a vector a large amount of projectiles. These projectiles have at least one position and speed to make calculations, and I’m trying…
-
5
votes2
answers295
viewsWhy did a dynamic array work without the use of malloc()?
Follow the code passage below: int main(void) { int tam, vet[tam]; printf("\ndigite tam: "); scanf("%d", &tam); return 0; } I didn’t know this worked, because I’m typing the vector size at…
-
5
votes0
answers109
viewsWhat does high memory area (high memory area) understand in DOS?
I’m studying about memory management in DOS, and I haven’t found much information about what exactly is understood in this area of memory. Hug.
-
5
votes3
answers540
viewsColo allocate a memory based on the size the user typed
How can I get it right after the user enters a string the program counts the number x of characters of this and allocate X bytes to it? I am not able to do it, I tried for example to make after the…
-
5
votes2
answers378
viewsHow does PHP treat temporary expression regarding memory?
In PHP, it is possible to iterate the elements of a array through the foreach, both with the variable that contains it and with what PHP called "Temporary array Expression". Example: $myArray = ['a'…
-
5
votes3
answers2379
viewsHow to see how much memory occupies such a variable in C++? And how to use the define?
How to see how much memory occupies such a type variable int, char e long in the C++? And how to use the #define?
-
5
votes1
answer1284
viewsphp vs nodejs performance on websockets server
What I take for granted at the moment is that nodejs is more suitable to work with a constant pool of socket connections (websockets in this case) because being single-threaded each new connection…