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
-
3
votes1
answer49
viewsMaximum memory consumption on linux bash using openssl with aes
#!/bin/sh SUM = 0 for i in {1..5} do t=$((/ usr / bin / time-f '% e' openssl enc -aes-128-ecb -K 1234567890 -in t -out g 1> /dev/null) 2> &1) SUM = `bc <<<" $ SUM + $ t "` done…
-
3
votes1
answer73
viewsAllocate memory with pointer or reference?
Is there any significant difference between these two methods? MyClass &ref = (*(new MyClass)); MyClass *ptr = (new MyClass);
-
3
votes1
answer98
viewsHow does malloc() organize memory?
When I allocate memory with malloc(), address equals an array? Or are spread across the PC memory? I want to create a list of structs, to do this, I have to have several structs in case, I can do…
-
3
votes1
answer893
viewsShared memory between Linux C processes (mathematical operations)
I’m studying shared memory in C language and I need to do a simple program so that a shared variable starts with a value and then the program creates a child process where the variable will be…
-
3
votes1
answer149
viewsWhat is the difference between memmove and memcpy?
What is the difference between the function memmove() and memcpy()?
-
3
votes1
answer203
views -
3
votes1
answer224
viewsIs there a difference in finding the maximum value directly in SQL or checking it with PHP?
I saw in a question on the site a user get the maximum value of a given column of a table in the database as follows: $result_max = mysqli_query($conn, "SELECT CGenericas1 FROM…
-
3
votes3
answers85
viewsAre the variables of a function automatically deleted after its termination?
I am developing a function that has variables that carry a lot of data and as these variables are used only within this function it does not make sense that they continue occupying space in memory,…
-
3
votes2
answers84
viewsError of memory allocation
I am creating a C script to classify a triangle according to the 3 sides passed. For this I use three distinct variables, lado1, lado2 and lado3, as illustrated by the code below: #include…
-
3
votes1
answer111
viewsHow to allocate in contiguous memory a structure that contains 1 vector with user defined size?
I was wondering how to answer this issue and I came to the conclusion that I would need a data structure with: the size of a set a previously reported size vector It would be something like the…
-
3
votes1
answer61
viewsDo vectors and structures always have continuous addresses?
Why vectors and structures are continuous in memory? I believe that it is not just coincidence. #include <stdio.h> int main(void){ char s[10]; for (int i=0; i<10; i++) printf("%d=%p.\n", i,…
-
3
votes1
answer53
viewsWhy can I assign an instance of a class to a variable whose type is the interface?
Exactly what you mean when I create an object in memory, but I associate it with variable a1 interface-type (AreaCalculavel)? I’m a little confused, see below the example. package exercicio0101;…
-
3
votes1
answer76
viewsWhy doesn’t the matrix print out all the typed values?
#include <stdio.h> #include <stdlib.h> #include <locale.h> int main() { setlocale(LC_ALL, "Portuguese"); int linha=0, coluna=0, i, j, l, m; int matriz_A[linha][coluna],…
-
3
votes1
answer125
viewsWhere does the memory space required for each element in a C string array come from?
In C, you can group a set of string's, which are arrays of char's within a array without having to define 2 dimensions for this? That’s why you use a array pointer char's and simply defines the…
-
2
votes2
answers354
viewsWhat architecture and operating system properties allow a buffer overflow attack?
Attacks of the kind buffer overflow (data overflow or overflow) occurs when, while writing in a memory space, a program crosses the boundaries of the buffer and writes to an adjacent memory area. I…
-
2
votes1
answer149
viewsProfiling php (debug + run time)
Someone uses php code Profiling, other than with zend studio? The problem of zend studio is the license... but it is very good this functionality, there is something open source that is not as…
-
2
votes2
answers163
viewsArray of bitmaps firing Outofmemory even having sufficient memory
Problem I am having problem in my program that when the process reaches more than 1.5 GB of memory usage the process stops running and displayed an error of OutOfMemory. In my process I’m reading a…
-
2
votes2
answers304
viewsHow to free up memory after using a Filererence?
FileReference.load does not have a function to download, just as there is new Loader().unload. Must be a Flash BUG or Filereference needs to be improved, like in a new version add a function like…
-
2
votes1
answer451
viewsObject and pointer allocation
How do you allocate a pointer, which points to a class, and an object? Is there a difference? Size, etc
-
2
votes1
answer260
viewsSystem.Outofmemoryexception - Parser for large files
I created a simple grammar to interpret a file whose format is much like a JSON. However, when I try to parse the file I get the exception Sytem.OutOfMemoryException. This is because of the file…
-
2
votes2
answers255
viewsCan the webservice set a limit memory usage for who queries it?
I’m having trouble with a webservice because I make a query that returns 69300 records and everything goes well but already with 69595 records it gives error. The question: The webservice can you…
-
2
votes2
answers121
viewsWhich of these three codes is the most recommended in memory and speed?
I would like to know which of these codes would be more recommended for speed, since the three do the same job: 1 $rand_length = 1; $rand_rules = range(0, 9); shuffle($rand_rules); $rand_rules =…
-
2
votes1
answer388
viewsDynamic Memory Allocation in Cobol
How to allocate dynamic memory in Cobol without using external C libraries? I have no interest in using some kind of *alloc() from C. In any flavor of Cobol exists? It must exist, because if some…
-
2
votes1
answer437
viewsSave Arraylist to the external memory of an Android phone
have how to save an Arraylist by Fileoutputstream in the memory of an android phone? Or have some better method? For example: FileOutputStream fos = openFileOutput("Foto_Imovel",…
-
2
votes1
answer223
viewsMemory consumption (HTML element x jQuery objects)
I’m creating a system where I need to record many DOM elements in variables. Is there any difference of memory consumption in writing HTML elements x jQuery objects? HTML elements: var elemento =…
-
2
votes2
answers7781
viewsGenerate random number without repetition in C
Hello, I am making a memory game in c, and would like to know how to generate a random number without repetition. I will post what in the function so far. I will need to do another function only to…
-
2
votes2
answers864
views -
2
votes2
answers834
viewsOptimization of Mysql connections
I have a pertinent question regarding the connections in my database. I was told that every new connection to Mysql a portion of the RAM is reserved for that connection. I have several applications…
-
2
votes2
answers92
views -
2
votes1
answer193
viewsProblem with dynamic allocation
I need to make a code where the user fills in an array as many times as he wants, but the code stops running. If I register only 3 values, like (1) (2) (3) it works normally, but in some moments…
-
2
votes1
answer2017
viewsHow to store data in RAM and make it available to any module or class in my application?
There are several ways to store the data of a particular application and some of them are: Disk Storage (HD). It can be a text file, XML, or a database file of some DBMS. Cloud Storage (Cloud). It…
-
2
votes2
answers131
viewsWhat is the limit of multidimensional vectors?
I’m doing a test and it gives me an error when I try to create a vector[1000][1000]. There are limits to vectors? The error code (application ceases to respond) is the following: int main (){ int…
-
2
votes1
answer265
viewsWhat is the "right way" to use PHP destructors
When searching for references of good practices in PHP for memory management I came across several intentions of how to use destructors. I know the leading actor is Garbage Collector but this is not…
-
2
votes1
answer449
viewsWhat is the smallest memory unit of a processor?
I wanted to know which is the smallest processor memory drive? Will it be the data loggers or is there anything smaller than them?
-
2
votes3
answers2408
views -
2
votes2
answers44
viewsWhich way to change variables is more optimized?
I made two ways to change the value a and b, but which is more optimized, taking this example to other languages like desktop or web. No use auxiliary variable: $a = 10; $b = 5; $a = $b+$a; $b =…
-
2
votes1
answer949
viewsProject C# Closing Visual Studio
I recently made a Console Application project that saves PDF files with Report Viewer and worked normally. I needed to change the SQL Server that generates these files and changed the directory to…
-
2
votes2
answers67
viewsWhat is the best performance in comparison of string sizes?
What is the best performance option? And memory allocation? Using option 1 or 2? String text = "ola mundo"; Option 1: If ( Strings.len(text) > 0 ) {} Option 2: If ( text != "") {}…
-
2
votes1
answer895
viewsMeasure memory usage in c
Hi, can I measure the use of ram memory of a program made in c? Do you have any specific tool or something like?
-
2
votes1
answer195
viewsIs it possible to store files in an executable?
I need to store a file, no matter its extension (it’s mainly an Executable) within another executable. It’s just, I’m compiling with Codedom an executable that inside it there is a file "special"…
-
2
votes2
answers120
viewsHow to format strings and store them in a dynamic vector
In several parts of my code I need to use bash commands to run programs on Ubuntu. To do this, format the command using sprintf and then run with the system function. Ex: sprintf(sprintfoutput,…
-
2
votes3
answers447
viewsProblem in the use of malloc and realloc
int main() { int **matriz; f(matriz); return 0; } void f(int **matriz) { int x, l=1,c=3; matriz = (int **) malloc(sizeof (int)); *matriz = (int *) malloc(3 * sizeof (int)); printf("Insira o valor de…
-
2
votes1
answer101
viewsSegmentation Fault function that changes the values of 2 strings
The following function changes (or at least should) the content of two strings void trocar(char *a, char *b){ char *novo = (char *) malloc(sizeof(char) * 10); strcpy(novo, a); strcpy(a, b);…
-
2
votes1
answer187
viewsDoes Garbage Collector remove all objects or only those that have no reference?
In a Java application there are objects that are not being used, among these objects there are those that have no reference. Like the Garbage Collector deals with it? He removes all or only those…
-
2
votes1
answer129
viewsWhat is the size of the memory according to the size of the address?
I’m having some difficulty answering two questions based on the following information: Hardware support for virtual memory; Works with 1KB pages; Works with 24-bit virtual addresses; Works with…
-
2
votes1
answer216
viewsWhen I create a function in C++ do the variables within it stay in memory?
When I was studying pseudocode, I learned that when you call a function and create a variable, it only "exists" when I call that function, for example. funcao teste(): x = 10 retorna x In case, when…
-
2
votes2
answers593
viewsC# - High memory consumption
I’m having memory consumption issues with an application that receives real-time news alerts. Whenever a news arrives, when opening this news, the memory consumption grows, but does not decrease in…
-
2
votes1
answer150
viewsProblems with the Realloc
Good afternoon, I’m having difficulty creating a program that increases the size of a structure called list , similar to an array, whenever the occupancy rate of this list is more than 80% filled so…
-
2
votes1
answer263
viewsHow do I pass the first char address of a string to a function to write to it?
The problem is this: I made a function that takes the output of a given OS command and stores it in a string. The idea now would be to declare a single char string in my main function using malloc,…
-
2
votes0
answers396
viewsLimit use of RAM in R
I’m running some analysis and would like to fix the use of RAM in R to be able to use other software simultaneously without any problem. So I’d like to, for example, limit the 4gb of RAM memory,…