Most voted "memory-management" questions
Memory Management is the field in which questions related to the techniques of use, allocation and memory recycling used by a program are studied.
Learn more…125 questions
Sort by count of
-
1
votes1
answer61
viewsShow photo of a listbox item gives me error Out Of Memory
I’m making a tool that turns a photo made upload by the user in bytes array then compare these Bites with the existing photos in the database I was able to make the code work but when at the end it…
-
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
votes2
answers80
viewsUse extra space in addition to that reserved by "malloc"
When we request an amount of memory from the system and use much more than requested, what happens? I did this test and the code here compiled normally. At first it worked as it should, I wanted to…
-
1
votes1
answer470
viewsDelete a struct record using free()
I’m creating a record using struct, where I must have a menu to include, show and attend (exclude) patients. The problem is in the exclusion function that because of my lack of knowledge I do not…
-
1
votes1
answer94
viewsHow to create a matrix with dynamic allocation and structs
I know how to create a matrix using dynamic allocation only. However, I’m not able to create using structures. I have the following struct: struct matriz{ int** elemento; int nlinhas; int ncolunas;…
-
1
votes1
answer33
viewsStrategy to run regressions with many iterations without much RAM
I have a small database (872 Obs. of 27 variables). But the analysis that I need to make of this base ends up being very heavy, because it requires analysis of the iteration of many variables among…
-
0
votes3
answers85
viewsAllocator and placement new
I have a problem with placement new along with a "homemade allocator". The problem is that for data types (int) it works well, now for double, they start to trim very strange outputs. The classes:…
-
0
votes1
answer591
viewsHow to optimize memory consumption using Doctrine
I need to read and save in the database two files the first (smallest) has about 49,000 lines (each line will be become a record). I parse this file by creating an instance for the object and then…
-
0
votes0
answers493
viewsBursting of Memory (RELEASE)
I’m having a little problem with my code... is eating a Braba memory... and is not pouring memory ... a simple application within my program... Label printing... every time I print a label the code…
-
0
votes1
answer936
viewsDynamic allocation with struct
/* [Error] expected primary-expression before'*' token [Error] 'dia' was not declared in this scope [Error] 'mes' was not declared in this scope [Error] 'ano' was not declared in this scope */ This…
-
0
votes2
answers349
viewsDynamic matrix creation that stores broken text
Attempt to create a dynamic matrix using malloc(). I am in doubt if the parameters I send to the different cycles of the function will be right. int size=0,i,j,n=20; char str[]="Ola. Tudo bem?\n Sim…
-
0
votes1
answer286
viewshow to resolve "SIGSEGV" error when using`strcpy`
Hello, I am facing an error "SIGSEGV": strcpy(buffer_ReceiveAutomation, ls_buffer_PPouAUT); << ERROR and buffer is incomplete from recv, but if I change the sizeof(ls_buffer_PPouAUT) by the…
-
0
votes1
answer116
viewsLua has static and dynamic variables in the heap?
Does the storage binding (related to the variable’s lifetime) allow static variables? Allows dynamic variables of heap?
-
0
votes1
answer191
viewsAvoid memory leakage in return function
There is an exercise in the C++ book that asks you to create a function that returns an object avoiding memory leakage. I did so but I’m not sure if it really works: class Point1{ public : int x;…
-
0
votes1
answer348
viewsReading txt file in C and data interpretation
I need to read txt files in C and interpret the data from inside the files. The files contain parts in TEXT and others in DECIMAL/INTEGER numbers. What I need to do is read the whole file and pass…
-
0
votes2
answers78
viewsWhy does the program work despite the invasion of memory in the vector?
#include <stdio.h> #include <stdlib.h> int main() { char s[2]; int i; printf("Entre com os caracteres\n"); for(i=0;i<4;i++) …
-
0
votes2
answers47
viewsStruct array accepting more than defined, what’s wrong?
In the code I created a array of the kind Pessoa containing only 2, but when it starts to iterate on the for loop and accesses index 2 and 3 the condigo continues without generating error at compile…
-
0
votes1
answer110
viewsI need an explanation why the C code gives a Segmentation fault error
I started my dynamic allocation studies but I’m not able to make a simple example, I couldn’t find the problem. #include <stdio.h> #include <stdlib.h> #define SUCESSO 1 #define FALHA -1…
-
0
votes0
answers30
viewsHow to ensure password security when extracting a Securestring in C# WPF
I was reading about Securestring and what she can offer. However, I am in a scenario where I have a Passwordbox and I want to extract the password of this component, encode it in hash and then…
-
0
votes0
answers48
viewsDynamic memory with c++ pointers
Hello, I’m starting to use dynamic memory in c++, but I ran into a problem. When I do new CHAR_INFO[3], says cannot Convert 'CHAR_INFO* {aka _CHAR_INFO*}' to 'int*' in assignment and still misses…
-
0
votes3
answers176
viewsDynamic allocation with a void function
I made a simple code using dynamic allocation. Just ask for the vector size, to insert data and print them at the end I can make dynamic allocation with int, returning the vet, but as I’m learning,…
-
0
votes2
answers208
viewsIs it always good to de-locate the memory before a "sudden" output of the program with the Exit function call?
When I was beginning to learn pointers and dynamic memory allocation in C, I was told that all memory allocated in the program is out of focus when it is finished. Ex: #include <stdlib.h> int…
-
0
votes1
answer178
viewsRow function in C
I created the next queue: typedef struct No { int pos; char cpf[12]; char nome[40]; struct No *prox; } No; typedef struct No * p_no; typedef struct{ p_no ini, fim; } Fila; typedef Fila * p_fila; And…
-
0
votes1
answer84
viewsReturn malloc to pointer does not stay between functions
I have these two examples here: example 1: void copiaStr(char *a,char *b){ b = (char *) malloc(strlen(a)); for(int i = 0; i < strlen(a) ;i++){ b[i] = a[i]; } } int main(){ char *a = "alou"; char…
-
-3
votes1
answer253
viewsHow do I wipe the memory to avoid overloading?
As you read the HTML of the site, go deleting what is before. If there is any clear screen in Python. import mechanize response = mechanize.urlopen("https://www.exemplo.com") m = 0 linha = '' if (m…