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
-
2
votes1
answer48
views -
2
votes1
answer79
viewsDetermine the memory consumption
Hello, I’m a beginner in Go and I’m having a hard time determining how much memory the Go code took to execute some code. I made the memory() function that even returns something, but I don’t know…
-
2
votes2
answers1154
viewsWhat type of variable allocates less memory, integer or string?
Imagining the situation I’m taking from the database a field number, which represents the client’s code. This value tends to be between 1 to 50000. I must for this case save as string or how integer…
-
2
votes1
answer122
viewsHow to copy a structure pointer?
Is it possible to clone a structure pointer? Follow the code: typedef struct{ int numero; }estrutura; int main(int argc, char *argv[]){ estrutura *i = (estrutura *)malloc(sizeof(estrutura));…
-
2
votes1
answer58
viewsHow is a executable erased from memory?
Sorry if this question seems repeated but is this question did not answer what I wanted to know:as a program is loaded into memory The .exe is loaded whole into memory or parts of the program are…
-
2
votes1
answer59
viewsSegmentation Fault na strcat()
Recently I started learning about function strcat() and developed the code below, but I’m encountering a Segmentation fault: #include <stdio.h> #include <stdlib.h> #include…
-
2
votes1
answer50
viewsValgrind problem and dynamic allocation in C++
I have a program a little bigger than that, I selected the part that I can not solve, are errors that seem unfounded, I’ve really tried everything. I imagine it’s a structural problem. I will post…
-
2
votes1
answer199
viewsWhat is the difference between "value types" and "Reference types"?
I didn’t quite understand these classifications among the types that a variable can contain that are value types (types of value) and Reference types (reference types) that exists in the language…
-
2
votes1
answer102
viewsMemory allocation for string array with malloc()
This code below asks for a num for the amount of strings I want to store in vetor which in this case is the pointer char *strings[num]. #include <stdlib.h> #include <stdio.h> int main()…
-
1
votes3
answers329
viewsUse of codeigniter memory
I made my first application in codeigniter, at first it was working all right. However when I looked at the server memory, it is very high, it starts with little use, and with each request it…
-
1
votes2
answers420
viewsHow to remove a variable from memory?
How to remove a variable, not necessarily from the code, but from the memory/record, in C? Hypothetical example: char meu_byte; //codigo deleta_da_memoria(meu_byte); That generates something like:…
-
1
votes1
answer79
viewsPassing address to Writeprocessmemory
I’m trying to pass a memory address to WriteProcessMemory(), only that this address should be typed by the user, I am in doubt of how I can do this, I tried with strings, wstring, did not succeed.…
-
1
votes1
answer62
viewsMemory Leak in Video Player
I’m implementing an application in C++/cli and Winforms that features videos continuously. During execution, when videos are loaded the memory increases and is released later. I’ve noticed that…
-
1
votes0
answers626
viewsWhat to do to decrease the processing of Memoria RAM in VBA?
I am making a spreadsheet, and whenever I run my macros it starts to crash, I saw how much of Ram ta using and ta 1.6GB and the file each time it saves increases significantly in size, now it is…
-
1
votes2
answers818
viewsWhat is the most efficient way to resize bitmaps on Android?
When a device has smaller screen resolutions, you need to resize the bitmaps to optimize its display on the display properly. The problem is that the use of createScaledBitmap can generate a lot of…
-
1
votes2
answers147
views -
1
votes2
answers198
viewsHow to create variable to contain a number with millions of digits?
I saw a report about the discovery of a prime number that contains 22 million digits. How could a variable contain a number, for example, with 100 million digits.
-
1
votes1
answer189
viewsSegmentation failure
I created a class to display a string at the terminal, but in addition to displaying the string, also, displays the following message: "segmentation failure". I debug with GDB, but could not resolve…
-
1
votes1
answer405
viewsThread occupying a lot of memory
Come on . I’m loading Buttons into a panel through the Backgroundworker. That is, within this Background I execute a query in the bank through the EF and fill the panel with the Buttons that contain…
-
1
votes0
answers213
viewsConfigure Mysql Memory Usage
I have a Windows Server 2012 server with 24GB RAM, AMD FX 6100 processor with 6 cores. I would like to configure Mysql for better performance reading and importing bases, someone can help me set up…
-
1
votes1
answer326
viewsHelp with Inner Join: "No space left on device"
I don’t have much knowledge in programming and experience in SQL, however, I need to do a search in a Postrgeesql database (I’m using pgAdminIIII) where I need to join two tables. create table…
-
1
votes1
answer175
viewsWhat is the increment on a pointer for?
Datum: #include <stdio.h> int main () { int x = 1; x++; int *y = &x; y = y + 1; printf("%d\n",x ); } The exit is 2. In that case I would like to know if the following interpretation is…
-
1
votes1
answer390
viewsClone a struct without copying the memory address
I need to copy the struct problema1 to the struct problema2 , but to do the way it is in the program below , when I change the struct problema2 also be changing the struct problema1. The way I did…
-
1
votes0
answers131
viewsProblems with memory buffer pool doMysql
Hello, I have a machine EC2 in AWS radando Ubuntu server. It turns out that the MySql stopped working and does not come back anymore. The log error shows the following: 160919 21:20:21 [Note] Plugin…
-
1
votes1
answer154
viewsInsert node into binary tree
How to insert a node into a binary tree? It always gives segmentation error when the code enters if (arv == NULL) struct no { int info; struct no *esq; struct no *dir; }; typedef struct no node;…
-
1
votes1
answer71
viewsSomething simpler than that to allocate a dynamically typed text?
// FUNCAO // char *nome(char text[20]) { char *n; int n2; int n3 = 0; printf("%s\n",text); while((n2 = getchar()) != '\n' && n2 != EOF) { if(n3 < 1) { n = (char*) malloc(sizeof(char));//…
-
1
votes1
answer133
viewsDynamically allocating text, and error in free()
I’m trying to allocate dynamically, but the error is appearing: Error in . /name. c; invalid : 0x000001c18834 My code: // FUNCAO // char *nome(text[]) { int n3 = 0; int n2 = 0; char *n = NULL;…
-
1
votes1
answer248
viewsWhat is the reason why a vector with no set size does not work?
If you create a vector: Thus int Vetor[0]; works #include <iostream> using namespace std; int main() { int vetor [1]; vetor[0] = 12; cout << vetor[0] << endl; } Thus int Vetor[];…
-
1
votes1
answer69
viewsC# - Outofmemoryexception when searching for thousands of Active Directory groups
I’m searching thousands of groups with hundreds of users each of Active Directory, but it’s consuming a lot of memory. It starts with about 300 MB and when it reaches about 1800 MB, seen in the task…
-
1
votes2
answers263
viewsHow to avoid array overflow in C++?
My show was exhibiting some weird behavior, until I found out that there was a bang of array, for example: int arr[3]; for (int i = 0; i<10; i++) { arr[i]=i; cout << arr[i]; } In this clear…
-
1
votes2
answers219
viewsLoop memory and processing optimization
The code is simple and is working perfectly, but wanted tips on how to optimize it, what would be the best methods to use to allocate less memory, best practices, etc. using System; using…
-
1
votes2
answers280
viewsProblem with pointer and array
I wanted to print the corresponding locations and values of a array using a pointer but when I ask the pointer to add the vector location to 8 (which corresponds to the 8 bits of an integer) the…
-
1
votes1
answer168
viewsFunction removes chained list
Save everyone, I’m learning chained list in python, as I already have some knowledge of list in C hit me doubt about node removal, the basis of the algorithms I used in some exercises is this:…
-
1
votes2
answers659
viewsMaximum size of a character array
Has some maximum quantity, that a variable of type char character support? For example, I could use char texto[1000];? #include <stdio.h> #include <stdlib.h> #include <locale.h>…
-
1
votes2
answers267
viewsWhen to actually use malloc() and/or calloc()?
My doubt is due to the fact that I am learning from banal examples (in my view), as in: int *ptr; ptr = malloc(sizeof(int)); It seems to me useless to allocate a space of an integer to a pointer of…
-
1
votes1
answer99
viewsMemory pointer and allocation
I know which pointer stores memory address. And a variable stores a value. But taking into account that I have a class class player {} and create a variable player p; and an instance of a pointer…
-
1
votes3
answers412
viewsLack of Java memory even though the computer has available memories
The Java Virtual Machine "JVM" can run out of memory even if the physical machine has available memory?
-
1
votes1
answer38
viewsHow to limit a value entered/modified by the memory address?
To limit a value that has been entered/changed by the memory address? PS: I can not limit by function, this function is just an example function showing the problem, I will need to pass this object…
-
1
votes0
answers27
viewsFinishing a java object variable with null - Will it be removed from memory?
public class TesteMemoria { public static void main(String... x){ ASayboltFurolViscosity objeto; for (Double i = 30.0; i < 40.0; i++){ objeto = new AlgoritmoASTMD2161_v1999_SSF(i,…
-
1
votes2
answers214
viewsWhy does the value always return 0?
In the code below the result of the variable valor_1 always is 0. But reversing the order of the variables declaration to unsigned char valor_2, valor_1; the program works correctly. What’s the…
-
1
votes1
answer195
viewsWhy is the "long int" limit equal to the "int`"?
The boundary of type int is 2147483647, but the type limit long int is also 2147483647. Why the limit has not increased?
-
1
votes2
answers139
viewsHow to test if the free(); function worked correctly?
I’m creating the abstract kind of 2D Matrix data, and one of the functions I’m doing in TAD is this: int mat2D_free(TMat2D *mat) { free(mat->data); free(mat); } That is, a function to destroy the…
-
1
votes1
answer110
viewsStore multiple boolean states in only one bool variable
The guy bool so much at C as in C++ consumes at least 1 byte of memory to be stored, I saw that this is because it needs to be addressed or something. So, it would be like this 1 byte to store more…
-
1
votes0
answers25
viewsHow to view data from a TXT in my arrayList - Android Studio
Currently I do so: ArrayList<produtoItem> lista = new ArrayList<produtoItem>(); lista.add(new produtoItem(R.drawable.imagem, "AA", "AA", "AA", "AA")); adapter = new produtoAdapter(this,…
-
1
votes2
answers270
viewsUse a constructor with multiple parameters, or create multiple sets?
Amid use a constructor with multiple parameters or give a lot of sets, which of these options is more performative for the compiler, would cost less memory and would be faster?…
-
1
votes2
answers90
viewsExit error while trying to print contents of.txt file
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <getopt.h> typedef struct{ char **matriz; } Dado; void ler_agumento (Dado *dado, int argc, char **argv){…
-
1
votes1
answer311
viewsdouble free or corruption (out) - Using C++ matrices
I’m writing a class that deals with C++ matrices. However when creating a method to calculate the determinant of a matrix I am bumping into the following error: double free or corruption (out)…
-
1
votes1
answer647
viewsDynamic allocation in C++
I was learning a little bit more about dynamic allocation in C++ on the Internet, and a teacher’s code caught my attention. It is a code made to spend only the necessary memory and not have "blank…
-
1
votes1
answer48
viewsIf an object manipulated by a pointer is allocated in the heap, can it be collected by the Garbage Collector?
I am studying C# and I am in the pointers section. I understand that a pointer stores a memory address of an "object" (types by value and Array). The data stored by the pointer (the address) is in…
-
1
votes1
answer55
viewsCrash C program when running
Once I enter the variable data originalMoney the prompt crash. Follow the code (it’s incomplete, I only ran the test with the first case) #include <stdio.h> #include <stdlib.h> #include…