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
-
0
votes1
answer119
viewsPHP code to query MYSQL by leaking memory
All right, guys? Guys, I’m having a problem that I haven’t had before. I wrote the code below and at the time of opening the page by localhost in the browser it returns the following error: Fatal…
-
0
votes1
answer90
viewsProblem with Segmentation fault with whole pointer
The program below attempts to reproduce a cellular automaton model. When I use "n" (number of cells) above 65 thousand, the program returns Segmentation fault. I tried to "print" some text in…
-
0
votes0
answers43
viewsWebbrowser control accumulating memory with every use of the Navigate method
I created a program that uses Webbrowser to search for information online (Log in automatically and later bring the page information to the program). The program works perfectly, but it turns out…
-
0
votes0
answers18
viewsDifference in passing of data type by reference
Hello, I’m having doubts about how to pass determined by reference. Follow the code below: #include <stdio.h> #include <string.h> mostra_frase(char *frase){ printf("\nFrase digitada…
-
0
votes1
answer48
viewsI have dynamically stored memory of a vector in C, does not return the allocated size, why?
This code is an example of another code with the same problem. I dynamically stored the memory, but when I’m printing the vector size with the len, strangely prints 1 and not 10 as expected. The…
-
0
votes1
answer73
viewsIn C language working with strings would it be better to spend processing or memory?
In general in programming it is better to spend resources on processing (calculations) or memory (creating variables)? Contextualizing: I am developing a solution for a program that uses struct and…
-
0
votes1
answer112
viewsExcess memory usage with timer in javascript
I want to put a timer on a page, the function works, shows the time progressively, but I realized that the use of "setInterval()" begins to consume a lot of page processing until the point of the…
-
0
votes3
answers335
viewsError when De-locating Matrix - double free or corruption C
Hello, I’m running a program to rotate a matrix, which after allocating executes the rotation function, and then displaces the data. The problem is when I try to dislocate, it’s returning me double…
-
0
votes0
answers54
viewsMatrix in memory block
Hello, everybody! I have one more question about matrices, more precisely in the memory occupation of each one. I’m trying to simulate what the guy in this video Performance x64: Cache 2 Cache…
-
0
votes0
answers137
viewsWhy does my SD card corrupt in the Afghan rescue?
I have a Kingston 4GB micro SD card and a Datalogger code that deletes the successful file and creates a new one with the new values of the variables. Follow the code below: void back_var() {…
-
0
votes2
answers179
viewsIs there realloc() in C++?
The realloc() is unique to C? Would it have any function that would be equal in C++?
-
0
votes1
answer154
viewsDo you need to allocate memory when you have struct inside another struct?
I want to save and recover data from a struct, but this struct has other struct inside it, I don’t know if I did it correctly, I don’t know if I should use typedef or just struct. I don’t know if I…
-
0
votes0
answers25
viewsmatrices without size in C
I have a doubt that came to me while learning about matrices of a dimension (no size). Follow an example: #include <stdio.h> int main(){ int matriz[] = {1,2,3}; } My question is: and if I then…
-
0
votes0
answers12
viewsHow the operating system or firmware knows the end of memory
My doubt is until simple: One thing I don’t know yet is as the operating system or firmware knows the end of memory, kind of a free() in C, you know where the memory allocated ends. Does anyone…
-
0
votes1
answer216
viewsError: stack Smashing Detected
I’m having the mistake: * stack Smashing Detected *: terminated in my program Use the compiler g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, here is the code: #include <iostream> using…
-
0
votes0
answers19
viewsC-struct occupies more memory space than the sequence of its members
No 1° example a struct occupies 16bytes: #include <Studio.h> int main() { struct horario{ int hora; int minuto; int *h; }; struct horario agora; int tamanho = sizeof(agora); printf("%d…
-
0
votes2
answers77
viewsMemory allocation with malloc()
Doubt 1: The pont should reserve a memory block for 1 integer which was requested on malloc(), but he reserves 32 bytes or a memory block for 8 integers. 'Cause he does it? Doubt 2: If I make one…
-
0
votes1
answer45
viewsPrinting vector memory garbage
How do I make a program not print vector trash? For example, I created 2 vectors at the beginning of my program with 5 elements each. If the user type numbers above 10 stores in v1 if it is larger…
-
-1
votes1
answer35
viewsSize of memory addresses
I was watching a video where a guy tells his 32-bit architecture the memory address and 1 byte , but it wouldn’t be 4 bytes?
memoryasked 9 years ago alexsander 483 -
-1
votes1
answer65
viewsMemory leak in Return
I’m reading a book and I came across this code: class SimpleCat { public: SimpleCat (int age, int weight); ~SimpleCat() {} int GetAge() { return itsAge; } int GetWeight() { return itsWeight; }…
-
-1
votes1
answer51
viewsGet full system memory and system components in java
Is there any simple or reliable method to take the total memory of the computer and/or the components or models of the computer components? I did a lot of research and the only thing I found was…
-
-1
votes1
answer110
viewsUsing static or dynamic variables in my codes? What would be more efficient or better seen in the job market?
What’s better: Using static or dynamic variables (using pointers in the case) in my codes? What would be more efficient or better seen in the labour market? I imagine that each one has its most…
-
-1
votes1
answer151
viewsHow to save a CSV in memory using Python?
Hello! I need to read a big CSV, break it into 1000-line Csvs, store them in memory and then reset a zip with these smaller files. This is the code so far: import pandas as pd from io import…
-
-1
votes1
answer59
viewsDynamic memory allocation gives error while accessing
I have a problem with my code: #include <stdlib.h> #include <stdio.h> #include <stdint.h> void a(void *po, size_t t) { void *r = realloc(po, t); } int main() { uint8_t *array =…
-
-1
votes1
answer47
viewsDynamic allocation in wrong scope
I dynamically allotted a vector of structures with qtdeFuncionarios positions within a if, but now I need to use it within another conditional structure and the compiler accuses scope problem. How…
-
-1
votes1
answer116
views"Segmentation fault" error while running C program on linux shell
I have the following program in C language: #include <stdio.h> #include <string.h> #include <stdlib.h> int main (int argc, char *argv[]){ FILE *p; char str[30], frase[]="Nome do…
-
-1
votes1
answer25
viewsHow to create a directory structure in memory with Python?
Hello. I have the following scenario: I am reading a dataframe, which has a column with Xmls. I am writing these Xmls to files. xml separately, to later save them in a certain folder structure and…
-
-2
votes3
answers99
viewsIf I declare a variable and do not use it in the body of the program, will it compile?
I have a program and left a declared variable, but I did not use in the body of the program.
-
-2
votes2
answers47
viewsMembers of a structure as pointers
In the code below I am trying to define a structure whose members are pointers that will be used to work with the name, email and age data, all dynamically allocated, of an employee. However, the…
-
-2
votes1
answer104
viewsSegmentation fault when returning to main C++
I am getting this error, I know it is an improper memory access error but I can’t find the error! it finishes running the wayValido(...) and when it will return from the main it crashes and gives…
-
-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…
-
-3
votes2
answers40
viewsWhy is my vector ordered if I am ordering in a function (void) without any return?
When sorting a vector, in a function of type {void} why the vector (original) in my function call is shown as ordered since the vector that was ordered was the vector referring to the formal…