FAQ Database Discussion Community


physical memory userspace/kernel split on Linux x86-64

memory,memory-management,linux-kernel,kvm
Is there an explict split between userspace and kernel in physical memory on Linux x86-64? That is, given a physical address, can I tell whether this address is from userspace or not? As far as I know, in virtual address space, the kernel will use the upper half and the...

why does the following code crash. (dynamic memory)?

c++,memory,dynamic
My program counts the occurrence of each digit from 0 to 9 in a string. It seems to me that i have done everything correctly, but a problem still persists. int main(){ string word = "23456745"; int* ReturnArray = count(word); for(int i =0; i < 10; i++){ cout << i...

C++ function memory alignment

c++,memory
I have read something like that before but unfortunately, forgot some details. Please, explain function memory alignment: int f(int a = 3, int b = 5) { int c = 7; int *p = &c; std::cout << "Pointer value: " << *p << "\tPointer address: " << p << std::endl;...

Unable to increase PHP Memory Limit

php,apache,memory,memory-management,out-of-memory
I am running into an issue with a project I am working with on my localhost, where I am unable to increase the PHP memory_limit setting. I've tried increasing it directly in the php.ini config: memory_limit = 1024M I've tried increasing it in the projects .htaccess file: php_value memory_limit 1024M...

Doc2vec MemoryError

python,memory,gensim,word2vec
I am using the doc2vec model from teh gensim framework to represent a corpus of 15 500 000 short documents (up to 300 words): gensim.models.Doc2Vec(sentences, size=400, window=10, min_count=1, workers=8 ) After creating the vectors there are more than 18 000 000 vectors representing words and documents. I want to find...

Improve RAM usage behaviour to avoid lags

c#,.net,performance,memory,real-time
We have a problem which seems to be caused by the constant allocation and deallocation of memory: We have a rather complex system here, where a USB device is measuring arbitrary points and sending the measurement data to the PC at a rate of 50k samples per second. These samples...

can paging be slower/faster than swapping on a machine?

memory,operating-system
This is a very naive question, but I wonder if there is any comparison that can be made on paging or swapping speed? They are offering the same functionality (moving from memory to disk, etc) but with different strategies (writing frames, or writing down the whole memory). Now the problem...

Memory javascript dictionary

javascript,memory
If I add a value to the 1000th element of a javascript dictionary then is there any difference to adding that value to the 0th element assuming those positions are open. I'm speaking in terms of memory consumption. ex. arr[1000] = 'asdf'; versus arr[0] = 'asdf'; ...

How can I know which process is using swap?

linux,memory,swap
There is lots of memory avaiable(about 4G) but swap is used(200+M) in my fedora box. I wonder which process is using swap. How can I know it. ps and top only show the memory usage. Thanks in advance....

memory footprint section in c

c,memory
could you explain what these section mean when you collect memory footprint in c? I can see .text is source code and I assume .const and .data are global data and constants(but not too sure) and what does .bss mean? | .text | .const | .data | .bss | ...

Where exactly is this object being stored? (Swift)

function,swift,memory,stack,heap
Consider the following code: class Foo { } func foo() -> (Void -> Foo) { var foo = Foo() return { foo } } var fooGen = foo() Now whenever I call fooGen, I get my stored Foo instance. But where exactly is foo being stored? Is it inside the...

Using parse.com and having allocation memory issue

android,memory,memory-management,parse.com,allocation
I'm new to programming, I've been making an app for the last 3 months and learned a few things. But I haven't come across to how to solve this issue. I've been using Parse.com as my server, sending pictures, saving user data etc. With all of this data the app...

In 64bit R, what should my memory.limit() be set to?

r,memory,64bit
I intend to work with some large vectors in R. memory.limit currently gives: memory.limit() [1] 4095 But I think that this is the default for 32bit R, whilst my installation is 64bit. What should my memory.limit() be set to in 64bit R?...

Changing Django code logs me out of application

python,django,memory
I am new to Django. I wrote a basic application. When I test it, every small change I make in the Python code logs me out from localhost. This happens when I use this cache backend: 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', but does not when I use this one: 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', Is there...

Android-activities continue to use RAM memory even if they are left

android,memory,android-activity,android-studio,ram
For several months I am creating an application for Android and I have a problem I can not solve : my application unexpectedly crashes after a few minutes of use. Thanks to the " Memory Monitor " of Android Studio, I can see that my application is using more and...

Profiling memory usage on App Engine

python,google-app-engine,memory
How can I profile memory (RAM) usage on my App Engine app? I'm trying to address errors related to exceeding the instance memory limit. I've tried these things and, so far, they don't work or don't provide what I need. Appstats. This doesn't provide memory usage details. Apptrace. It hasn't...

The range of virtual memory address in userspace

c,linux,memory
In linux, the range of virtual memory address in userspace, in other words, the range of value returned by malloc, is same as entire 64bits virtual memory space? Or, is there any sub-range of 64bits virtual memory space which is guaranteed not to be seen in userspace? Answers for UNIX...

Program Runs Fine for Hours and Eventually Seg Faults with Memory Address 0x10 [closed]

c++,c,memory,arm
So I've been tracking some memory issue for the longest time. I'm coding in C++ and I can see that my program mostly works. I am monitoring my resources and I dont think I have a memory leak because my memory used stays below 12% (I'm on a system with...

Distinguish Windows services with the same ProcessName

powershell,memory,windows-services,monitoring,powershell-v3.0
I am adjusting a monitoring system which checks if a service is running or not. It does that by checking the process name and it's memory consumption. Once it drops below 1 MB an alert is triggered. Also I use the memory usage value to display it in a graph....

C# equivalent of Java Memory mapping methods

java,c#,memory,memory-mapped-files
While translating a Java project to C#, i got stuck with the following piece: RandomAccessFile raf = new RandomAccessFile(fileName, "r"); FileChannel channel = raf.getChannel(); MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, length); I'm not familiar with the memory mapping conception, I found a MemoryMappedFile class in C#, but don't know how to...

Optimal memory trace for a DAG of dependency evaluations

algorithm,memory,graph,compiler-optimization,directed-acyclic-graphs
I'm looking for an algorithm which to optimise the order of evaluations on a DAG, such that least memory is used. It might be a bit harder to explain, so I'll give an example what I mean. Consider that you have a DAG with multiple roots, which represents some form...

Relative performance of large and small lists and bytearrays of boolean values

python,performance,memory
I was writing a simple Sieve of Eratosthenes in which one produces a list of all of primes up to some number N without performing any division or modular arithmetic. Abstractly, my implementation uses an array of N boolean values which all start out False and are eventually flipped to...

Heroku RAM not increasing with upgraded dynos

ruby-on-rails,ruby,ruby-on-rails-3,memory,heroku
I have a massive function i have been calling manually through the heroku rails console. I have been receiving the error rapid fire in my logs: 2015-06-22T14:56:42.940517+00:00 heroku[run.9877]: Process running mem=575M(112.4%) 2015-06-22T14:56:42.940517+00:00 heroku[run.9877]: Error R14 (Memory quota exceeded) A 1X dyno is suppose to have 512 MB of RAM. I...

C++11 Allocation Requirement on Strings

c++,string,c++11,memory,standards
I had heard that C++11 was going to require strings to be allocated in contiguous memory. I even thought I saw a stack overflow question on it, but I can't seem to find it. I know that in practice both gcc and Visual Studio do allocate strings contiguously, I'm just...

C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application

c#,exception,memory,ram,unhandled
Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application while displaying details in a textbox but getting exception in console application.I've added all possible references..Not showing any error during compile time... using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq;...

System.Management, Management Object Searcher, and RAM

c#,memory,ram,system.management
I am brand new to coding and I'm having a go at trying to make a simple app that shows computer information in a multiline textbox, as you do. So, I managed to get the basics by searching the registry for os name, version, etc and using system.environment to get...

Looking into dynamic variables created using pointers?

c,pointers,memory,memory-address
I was wondering if there is a tool in any IDE which can be used to "look" into dynamically allocated variables in C. If for example I use the code below, it is not possible to use the watches (CodeBlocks) to track the variables, only the adresse the pointer is...

SetProcessWorkingSetSize does not work in compiling 64bit

delphi,memory
I use the following command to reduce the memory usage of my program, I'm actually testing it, only when I compile the program in 64bit this command does not work fot, no error occurs, only the memory in task managerIt does not decrease too, since in compiling 32bit works perfectly,...

Docker error : no space left on device

ubuntu,memory,docker,temp
I installed docker on a Debian 7 machine in the following way echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list sudo apt-get update curl -sSL https://get.docker.com/ubuntu/ | sudo sh After that when I first tried creating an Image it failed with the following error time="2015-06-02T14:26:37-04:00" level=info msg="[8] System error: write /sys/fs/cgroup/docker/01f5670fbee1f6687f58f3a943b1e1bdaec2630197fa4da1b19cc3db7e3d3883/cgroup.procs:...

How can I measure the memory occupancy of Python MPI or multiprocessing program?

python,memory,multiprocessing,mpi,mpi4py
I am doing this on Cray XE6 machine where I can't log in on compute nodes and there is no possibility for interactive session, therefore I would need to somehow use top command: run top in the background and have it take snapshot at regular times and send it to...

Passing pointer to dynamically allocated array by copy to function has unexpected result

c++,arrays,pointers,memory,dynamic
I was just messing around with passing pointers to functions to wrap my head around how it works and I came across some behavior that was unexpected. I have the following code: #include <iostream> #include <string> #include <fstream> #include <sstream> #include <cmath> #include <iomanip> using namespace std; struct t {...

Measure memory usage of a certain Linux driver module

memory,memory-leaks,linux-kernel,linux-device-driver
I want to check whether the kernel driver module which I just finished has a memory leak problem. But I don't know how to do it in kernel space. Dynamic memory allocation is very hard to handle I think. Anyone has the experience in debugging such memory problem in kernel...

fread(), solaris to unix portability and use of uninitialised values

c,linux,memory,stack,portability
Valgrind found the following error and I, after reading the documentation, the code and other questions in here couldn't figure it out why. Valgrind: first warning ~$ valgrind --vgdb=yes --vgdb-error=0 --read-var-info=yes --leak-check=yes --track-origins=yes debitadmin* debitadmin ==20720== Conditional jump or move depends on uninitialised value(s) ==20720== at 0x4013BC6: initialise (dbg.c:199) ==20720==...

Watch values of variables in KDevelop

c++,arrays,memory,kdevelop
I am using KDevelop as IDE for my C++ program. I have an array char buffer[1024] in my program. After reading data to buffer, I would like to check it manually.But in the left panel, I need to read the array character by character. Is there some way by which...

In Spark, what is left in the memory after a Job is done?

memory,apache-spark,rdd
I used ./bin/spark-shell to run some experiments and find out the following facts. When running jobs (transformation + action), I notice the memory usage in the top. For example, for 5G text file, I did a simple filter() and count(). After the job is done, there are 7g marked as...

OutOfMemoryError on tomcat7

java,jsp,tomcat,memory
I am developing a web-app which takes a zip file, uploaded by the user, unzips it on the server, and process the files. It works like a charm when the zip file is not too large (20-25MB) but if the file is about or over (50MB), it produces the OutOfMemoryError....

What does *(*)() mean?

c,pointers,memory,casting
I recently came across the following C-code: *(STRUCT_T*)(0xC6) STRUCT_T is a typedefed structure. Can someone explain what this means? My guess: STRUCT_T* casts the address 0xC6 to a structure pointer and * then retrieves the value (struct) stored at the address 0xC6?...

clEnqueueNDRangeKernel fills up entire memory

c++,memory,parallel-processing,opencl
I am currently trying to write an OpenCL application doing some memory intensive calculations. To track the progress of all the calculations I created a for loop which creates different kernel groups. Unfortunately, the calculation fills up my whole memory. My guess is that the kernels are not done executing...

Hypothetical Memory Usage Monitoring Program

c++,c,memory,monitoring
Would it be at all possible (I don't care about practicality or usefulness) to write a C or C++ program that monitored memory usage in the following, very basic way? Given that declaring a variable without assigning it a value results in it having the value of whatever is already...

1MiB = 1024KiB = 2^10. Nonetheless, why not use just 1000 byte instead 1024 to calculate size? [closed]

memory,binary,size,cpu
1024 = 2 to the power 10. Computers use binary system where the base is 2 (0 and 1). Humans use decimal system where the base is 10. So if I have 1 byte which contains 8 bit in modern computers I can represent up to 256 different states, possibilities,...

Memory Issue for Array Conversion

python,memory,numpy
If we convert a large array containing 0 and 1 as boolean to another array containing 0 and 1 as float, the size of array would be almost 10 times larger. What is the best way (if any) to handle this issue in python (Numpy) if we need this conversion?

Does Python copy references to objects when slicing a list?

python,list,memory,copy,slice
When a list is sliced, are the references to its contents copied from the original list? I can imagine that this may not be necessary, but I read the opposite (mentioned in passing). This question matters for instance for the following idiom, in the case of a very long my_list:...

Which channel type uses the least amount of memory in Go?

memory,go,resources,channel,internals
I find myself frequently using channels to get things to stop. In these cases the channel is being used solely as a means of signaling, and none of the data is actually used. For example: package main import ( "fmt" "time" ) func routine(stopChan chan bool) { fmt.Println("goroutine: I've started!")...

Memory usage in R during running a code

r,memory
I would like to check what is the top usage of memory during running a code in R. Does anyone know such a function? The only thing I found, so far, is the function mem_change from pryr package, which checks memory change before and after running a code. I work...

I am getting error in this code as “invalid indirection”

c,memory,dynamic,indirection
I am trying to dynamically allocate a contiguous block of memory, store some integer value and display it. #include<stdio.h> #include<conio.h> void main() { int i; int *ptr; ptr=(void *)malloc(sizeof(int)*5); //allocation of memory for(i=0;i<5;i++) { scanf("%d",&ptr[i]); } for(i=0;i<5;i++) { printf("%d",*ptr[i]); //error is found here`` } } } ...

AvailableVirtualMemory on IIS and Console application

asp.net,iis,memory,console-application
I'm having problems to get the real value of AvailableVirtualMemory in IIS and a Console application, as detailed below: When i run these commands on a Console application: Console.WriteLine(String.Format("Memoria virtual total: {0}MB", My.Computer.Info.TotalVirtualMemory / 1024 / 1024)) Console.WriteLine(String.Format("Memoria virtual disponible: {0}MB", CDec(My.Computer.Info.AvailableVirtualMemory / 1024 / 1024))) The Console shows me...

DF doesn't show swap partition

memory,centos7
I am using DF to check my disk usage and partition. Why doesn't it show my swap partition? I have 8GB for swap when I installed CentOS 7. [email protected] abigail]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 196G 30G 166G 16% / devtmpfs 3.8G 0 3.8G 0%...

function to get 2d-arrays from stack and heap

c,arrays,memory,memory-management,malloc
Consider a simple struct, Foo, which contains a pointer to some other strucrt, Baz. and a two-dimensional array, (stack-allocated): Foo arr[ARR_SIZE][ARR_SIZE]; Next, consider a function which mallocs (in the heap, obviously) a memory for a new 2d-array of Foos. A code snippet: Foo** arr_copy = malloc(sizeof(Foo*) * ARR_SIZE); for (int...

Detemine memory used by Hazelcast cache

java,caching,memory,hazelcast
I'm implementing the backend of a game in Java and I was told to use Hazelcast to cache some data from the database. How could I find out how much memory is used by the cache (necessary to determine the business cost of this solution)?

Memory management in game development?

android,memory
I'm new to android and i started to develop a game, I thought about memory management when loading images and using them for animations, I want to know how to manage it properly so it wont damage the game's smoothness, How could i proceed with this?. And while I'm asking...

DataTable does not release memory

c#,memory,memory-management,datatable
I have a data loading process that load a big amount of data into DataTable then do some data process, but every time when the job finished the DataLoader.exe(32bit, has a 1.5G memory limit) does not release all the memory being used. I tried 3 ways to release memory: DataTable.Clear()...

lldb read memory pointer

memory,reverse-engineering,lldb
It is possible to easily read a memory at a location pointed to by a another address. For example, $r0 = 0x15942600 at this memory address there is AC B8 EC 14 Now to read the memory at 0x14ecb8ac, I will have to do: mem read $r0 mem read 0x14ecb8ac...

In Linux OS, User Space uses which Memory Zone (Normal or Highmem)?

linux,memory
In Linux the RAM is divided in three Zones DMA Zone, Normal Zone, and HiGHMEM Zone. So when user space process requests for memory which zone is used when and why?

MapViewOfFile() no longer works after process hits the 2GB limit

winapi,memory,out-of-memory
MapViewOfFile() works without any problem if our process has not hit the 2GB limit yet. However if the process hits the limit then MapViewOfFile() no longer works even if some or all of the memory is deallocated. GetLastError() returns 8, which means ERROR_NOT_ENOUGH_MEMORY, Not enough storage is available to process...

Search for file in archive and load it into memory

c++,memory,archive,ram
Basically I need to load a file within an archive into memory, but since the user is able to modify the contents of the archive it is very likely that the file offset will change. So I need to create a function that searches the archive for a file with...

memory error when reading from multiple files

python,memory,iterator,out-of-memory
I am reading in 15 files that are located in a folder on my desktop. I can read in the first few files no problem but when i get a little more into it I end up getting a memory error that looks to be caused by Pythons built in...

Local variable length array

arrays,memory,c99
during some code refactor in C++ i meet following local variable length arrays void some_function(uint8_t length, uint8_t id, uint8_t * bytes)) { uint8_t string[length + 8]; //some transformation on string [1-8] elements do_something(string); } I am not familiar with C99 but using Variable-length array size [x+y] look like this will...

Allocated on the heap or the stack? [closed]

c#,memory,stack,heap
I recently asked a question about StackOverflowExeptions and the explanations were very helpful! However, I wrote a method and tried to figure out where T cached is allocated (heap/stack): private Dictionary<Type, Component> _cachedComponents = new Dictionary<Type, Component>(); public T GetCachedComponent<T>() where T : Component { //Not yet sure if the...

Converting collection to array with no extra memory

java,arrays,performance,memory,collections
I need to convert Map into 2D array, so I've wrote this piece of code but it eats a lot of memory and I can't figure out why. private DataItem[][] convertDataToArrays(boolean[] filter, Map<Integer, List<T>> dataSet) double[] data = new double[sizeOfNewVector]; DataItem[][] reducedData = new DataItem[dataSet.size()][]; for (int i = dataSet.size()...

Use MemoryMappedFile as BinaryReader

memory,compact-framework
I'm using MemoryMappedFile(MMF) to put large files in memory. Working with memory limit 32MB. 50MB file is loaded using MMF for 2-3 seconds. Reading data from MMF works fine and fast. The only problem for me is: I have big project with lot of using of BigEndianReader ( derived from...

Correct idiom for freeing repr(C) structs using Drop trait

c,memory,rust
This code works fine but gives a compiler warning on Rust nightly (1.2) #[repr(C)] struct DbaxCell { cell: *const c_void } #[link(name="CDbax", kind="dylib")] extern { fn new_dCell(d: c_double) -> *const c_void; fn deleteCell(c: *const c_void); } impl DbaxCell { fn new(x: f64) -> DbaxCell { unsafe { DbaxCell { cell:...

method on deleted instance of class still work?

c++,class,object,memory,instance
I have this code on Visual C++ 2010 #include <iostream> #include <string> using namespace std; class Human { private: int magic; int health; string name; public: int GetMagic() const; int GetHealth() const; Human(int, string); ~Human(); }; //helper int Human::GetHealth() const { cout <<"This returns Human::health" << endl; return Human::health; }...

Memory error in c++ (armadillo)

c++,memory,armadillo
I wanted to solve a kind of ordinary differential equation (master equation) and I wrote the following program in c++ by help of armadillo: #include <iostream> #include <armadillo> #include <iomanip> using namespace std; using namespace arma; cx_mat tens( cx_mat a1,cx_mat a2,cx_mat a3,cx_mat a4,cx_mat a5,cx_mat a6,cx_mat a7,cx_mat a8,cx_mat a9,cx_mat a10,cx_mat a11,cx_mata12,cx_mat...

How are function arguments stored in memory?

c,memory
While trying to make my own alternative to the stdarg.h macros for variable arguments functions, a.k.a. functions with an unknown number of arguments, i tried to understand the way the arguments are stored in memory. Here is a MWE : #include <stdio.h> void foo(int num, int bar1, int bar2) {...

Memory Management (Allocating Pages/Frames to Logical Addresses)

memory,memory-management,operating-system,paging,virtual-memory
I am new to Operating Systems and I was following this handbook which I am reading to get a better grasp on how computers really work. However having stumbled upon Memory Management I found it somewhat confusing when allocating Frames to Pages using Page tables. Say Page/Frame size is 4K...

Eclipse crashes with GC overhead limit exceded after linking google play services

java,android,eclipse,memory,libgdx
So I'm building a project using LibGdx and have had trouble for the past few days trying to fix this issue. I have followed many other posts about the same question but had no success. Essentially as soon as I link my android project with google-play-services-lib and try to debug,...

Numpy: running out of memory on one machine while accomplishing the same task on another

python,ubuntu,memory,numpy
For my project I need to store two large arrays in memory at once. I try to create them as follows: matrix_for_words_train = numpy.zeros(shape=(435679, 542)) matrix_for_words_test = numpy.zeros(shape=(435679, 542)) However, on my desktop pc the second string resulted in MemoryError.When I tried to perform this on my laptop, I succeeded....

Getting many memory errors when try to run it for few days in my web crawler [on hold]

java,memory,memory-management,out-of-memory
I am developing a web crawler application. When i run the program i am getting these error messages below: i've got these errors after running the program for more that 3 hours. I tried to allocate memory by changing eclipse.ini setting to 2048 MB of ram as it was answered...

Print global pointer gives coredump

c,memory,global-variables
I wrote a simple program below: #include <stdio.h> unsigned int *time = 0; int main(){ printf("time = %u\n", *time); return 0; } This will gives me segmentation fault on x86-64. Could someone explain the root cause?...

Destroy an object with variables (free memory)

c++,object,memory,delete,free
I am trying to create an event/date orginaizer in C++. The overview is like a calender show one month and every Day in this calender is an Object (type: EventCell) The class EventCell stores the events for his day in a vector (name: eventData with type: "EventInfo": class for storing...

Assigning memory dynamically or on the stack based on a condition (if statement)

c,memory
I have a C program in which an array of floats has its elements accessed quite often for the duration of the program. The size of the array depends on an argument that a user will input and therefore will vary. Generally, the size will be small enough (~ 125...

map with class value segmentation fault

c++,class,memory,syntax
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. set(key, value) - Set or insert the...

Memory management with Rserve on Windows

r,memory,rserve,pyrserve
I need to perform various tasks with Python: sensitivity analysis, optimization and simulation launching. However the first postprocessing of simulation results relies on R and a bulky database stored in Rdata (8 Gb with some data tables representing up to 3 Gb). So I need to iterate the call of...

Scribble uncovering bug in block use I don't understand

xcode,osx,debugging,memory,objective-c-blocks
I have a bug which I have uncovered by enabling Scribble in Xcode, fixing the bug is not an issue, it isn't implemented in the best way, I can just remove the whole block, but I don't understand why I am getting the issue in the first place, which tells...

Scrapy Memory Error (too many requests) Python 2.7

python,django,python-2.7,memory,scrapy
I've been running a crawler in Scrapy to crawl a large site I'd rather not mention. I use the tutorial spider as a template, then I created a series of starting requests and let it crawl from there, using something like this: def start_requests(self): f = open('zipcodes.csv', 'r') lines =...

Linux “free -m”: Total, used and free memory values don't add up [closed]

linux,memory
On a linux system, while using "free", following are the values: total used free shared buff/cache available Mem: 26755612 873224 389320 286944 25493068 25311948 Swap: 0 0 0 The total, used and free values don't add up. I'm expecting total = used + free. Question: What am I missing here?...

Profiling stable_sort

c++,sorting,memory,in-place
This page tells that whenever there is not enough memory, stable_sort reduces to an in-place algorithm with running time O(n(log n)(log n)): Complexity If enough extra memory is available, linearithmic in the distance between first and last: Performs up to N*log2(N) element comparisons (where N is this distance), and up...

My 64 bit machine can only store 4 bytes each memory location

c,memory,gdb,64bit,32bit-64bit
My computer is 64bit mac. How many bytes of information is stored in one of these locations in memory? When I tried something in gdb x /2x first 0x7ffff661c020: 0xf661b020 0x00007fff My code is #define PUT(p, val) (*((size_t *)(p)) = (val)) PUT(first, (size_t)some pointers); I use gcc -g to compile...

Java - allocation in enhanced for loop

java,for-loop,memory
I have small problem in java with allocation of my object in "enhanced for loop". I tried something like this, which gives me later nullPointerException: SomeClass tab[] = new SomeClass[100]; for( SomeClass x : tab){ x = new SomeClass(); } So... Earlier I code in C++ and It was possible...

Does PSS (Proportional Set Size) number for a process include the memory consumed by kernel code?

linux,memory,process,uss
I used the smem command to find PSS/USS numbers for a process. As per the smem man page, "The unshared memory (USS) plus a process's proportion of shared memory is reported as the PSS (Proportional Set Size)." Now does all the Linux kernel code resident in memory get included when...

HTTPNetStreamInfo::_readStreamClientCallBack(__CFReadStream*, unsigned long) increases memory allocation

ios,memory,memory-management,xamarin,httpclient
I am trying to download large video file with httpClient post method. I am working Xamarin.iOS, but it seems to be issue of iOS (NSURLConnection/session) as the Xamarin codes convert it into native one. My device is having IOS8.1. A memory is kept increasing when I try to download that...

Infinite allocation memory app crashes

c++,windows,memory,allocation
I have a code #include <iostream> using namespace std; int main() { while(true) { try { new int; } catch(std::exception e) { } } return 0; } So, when I run this code under Linux, my computer freezes when memory is end (as expected), but when I'm on Windows, my...

Good approach to clean application data programmmatically in Android

android,android-fragments,memory,android-activity,picasso
When I use RecyclerView and/or Picasso. It seems to cache and store alot of data in my application. However, I want to delete the stored data and the cache in a simple way whenever I am exiting my app. What is the simplest way to delete all data stored in...

Matlab - memory usage after solving a large system

matlab,memory,sparse-matrix,allocation
I'm trying to calculate the memory used by a MATLAB process before and after solving a large sparse matrix. I'm using memory and the direct solver A\b. What I want is just to mesaure by monitoring in some way the memory used by MATLAB and to calculate the difference between...

why the RES memory is changed for same code when different JVM XMX be setted

java,memory,jvm
I use the datastax driver to create NIO connections with Cassandra without do any other thing but just keep connection. What's more, when I set the XMX to 1G, the RES(from top -p [java pid]) will occupied about 400M memory, but when I set the XMX to 512M, the RES...

CentOS memory availability

java,memory,centos7
My system has 8GB ram and my system is CentOS 7. The system info shows the following memory usage. Memory Information Total memory (RAM): 7.6 GB Free memory: 143.4 MB (+ 6.1 GB Caches) Free swap: 7.8 GB Does this mean free memory is only 143.4MB, or 143.4 + 6.1BG?...

what's ARM TCM memory

memory,arm
what is TCM memory on ARM processors, is it a dedicated memory which resides next to the processor or just a region of RAM which is configured as TCM??. if it's a dedicated memory, why can we configure it's location and size?....

How Does Windows Pick memory for threads?

c++,multithreading,memory,heap
My previous post,(Edit: Now solved) New Thread Corrupting String Data: C++ was too complicated it seems. So this is a more general post to answer my questions. If a thread is created inside a If, For, while, case, ect. Is the thread's heap a sub set of the memory allocated...

C: free() for row of 2d int array makes program halt

c,arrays,memory,numpy,free
I am relatively new to C and have coded (or more precise: copied from here and adapted) the functions below. The first one takes a numpy array and converts it to a C int array: int **pymatrix_to_CarrayptrsInt(PyArrayObject *arrayin) { int **result, *array, *tmpResult; int i, n, m, j; n =...

Is it safe to read and write on an array of 32 bit data byte by byte?

c,memory,memory-alignment
So I have a void * data of 32 bit unsigned integers which represents the pixels. Is it okay for me to access one of the pixels with a char * and modify the values directly? Or is it better to store my new pixel in a temporary uint32_t variable...

Does the dart VM impose restrictions on the stack memory size of a native extension?

c,memory,dart,dart-native-extension
I'm learning to write a native extension and I noticed an odd occurrence. When I allocate a multidimensional array and access it like so: (excuse any messy C code and bad practices I might be using unless they're likely the cause of my error. My C is not-so-great) int table[rows][cols];...

memory allocation - Java vs C++

java,c++,memory,heap
Given class Line in both java and C++, and the following declarations in java and C++ respectively - Line[] p; and Line *p; What are the differences in semantics between the two languages when then running the following code: p = new Line[7]; In particular, do both languages assign heap...

How to figure out the optimal fetch size for the select query

oracle,memory,jdbc,fetch
In JDBC the default fetch size is 10, but I guess that's not the best fetch size when I have a million rows. I understand that a fetch size too low reduces performance, but also if the fetch size is too high. How can I find the optimal size? And...

Should I zero the allocated memory?

c++,linux,windows,memory
I am programming tcp socket and I'm using struct sockaddr_in server_addr; to set port etc. In some tutorials I have read that I should zero the memory of server_addr before using it. Should I? Is it posible that I'll get memory with some data which could cause problems? Is it...

sort runs out of memory

linux,sorting,memory,ram
I'm using a pipe including sort to merge multiple large textfiles and remove dupes. I don't have root permissions but the box isn't configured in any way to cut non root privileges further down than default debian jessie. The box has 32GB RAM and 16GB are in use. Regardless on...

I'm getting a memory leak for fopen_s but nothing is 'new'ed or 'malloc'ed

c++,memory,memory-leaks
I'm using MS VS2010 with a plugin called Deleaker to spot any memory leaks I might miss. It's telling me that there is 2 memory leaks on the fopen_s line but I'm not using new or malloc on anything on that line. Every other time it has found a leak,...

image rotation method leaves something in the ram

java,memory,bufferedimage,affinetransform
I am currently working on a game and for more diversity of graphics I want to call a rotate(BufferedImage imgOld, int deg) method a few hundred times to rotate some graphics (eg. tree stumps). With unrotated graphics I never had any issues with memory. But as soon as I started...

C++ object instance member function memory representation

c++,memory
How exactly are the member functions in C++ represented in memory? I understand that there are basically three types of functions: -Static: These are represented as any other global function -Virtual: These can be accessed through the vtable, during run-time, in order to perform dynamic dispatch. -Non-static and Non-virtual: I...

How to prevent MatLab from freezing?

matlab,memory,time,evaluation
Is there a way to limit the amount of time an evaluation is allowed to run? Or limit the amount of memory that MatLab is allowed to take up so it doesn't freeze my laptop?

How is disk memory being used/consumed by programs?

memory,disk,hard-drive
A dummy question: Recently my disk ran out of memory: I kept getting java.OutOfMemoryError, java heap space, later my Virtual Box encountered "Not Enough Free Space available on disk" error. Then it turned out that my 256GB SSD had been almost all consumed/used. So I was wondering how running the...