memory,operating-system , can paging be slower/faster than swapping on a machine?

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


Tag: 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 is, can one of them be faster than the other? And what does this depend on?


Paging always happens. It's just a mechanism of mapping virtual memory. Swapping is "paging + disk I/O", so therefore no, paging is neither an alternative to swapping nor can be slower than swapping itself.


clEnqueueNDRangeKernel fills up entire memory

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...

Difference between switch & bus architecture?

I was just going through a operating systems textbook but I got stuck at switch architecture . Please explain what it is and how it is different from bus architecture ?...

Heroku RAM not increasing with upgraded dynos

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...

Profiling memory usage on App Engine

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...

How my computer knows a char corresponds to which character?

Does my OS load a font file which maps the UTF-8 codes to characters(the way to render it ) when I start up my computer? Since there are a lot of different fonts, the font files will consume a lot of memory? Or the font files are stored in hard-disk...

Detemine memory used by Hazelcast cache

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)?

How to change ubuntu to root?

I am new to linux. when i list the files under folder 1, i see below result -rwxrwxrwx 1 root root 920 Jun 3 10:36 file1.xsd -rwxrwxrwx 1 root root 920 Jun 3 10:36 file2.xsd drwxrwxrwx 2 ubuntu ubuntu 4096 Jun 12 11:10 temp -rwxrwxrwx 1 ubuntu ubuntu 1853 Jun...

Memory management in game development?

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...

Watch values of variables in 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?

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...

Does the dart VM impose restrictions on the stack memory size of a 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];...

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

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...

The range of virtual memory address in userspace

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...

Memory usage in R during running a code

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...

Changing Django code logs me out of application

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...

Java - allocation in enhanced for loop

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...

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

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...

Memory javascript dictionary

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'; ...

Converting collection to array with no extra memory

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()...

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

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?...

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

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==...

AvailableVirtualMemory on IIS and Console application,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...

I am getting error in this code as “invalid 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`` } } } ...

Memory Issue for Array Conversion

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?

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

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...

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

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?...

function to get 2d-arrays from stack and heap

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...

Unable to increase PHP Memory Limit

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...

NSUserDefaults not working on Xcode beta with Watch OS2

I just installed the latest beta of Xcode to try Swift 2 and the improvements made to the Apple Watch development section. I'm actually having an hard time figuring out WHY this basic NSUserDefaults method to share informations between iOS and Watch OS2 isn't working. I followed this step-by-step tutorial...

SetProcessWorkingSetSize does not work in compiling 64bit

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,...

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

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,...

How to detect that music play in background

I want help in detecting if there is a music play in background on the phone or not because I play more than one music sequentially in my app but they are intersection thank you

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

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...

Using and having allocation memory issue

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 as my server, sending pictures, saving user data etc. With all of this data the app...

Trouble outputing file size to a label from a listbox in Python 3

I'm using os.path.getsize() to output the size of a file to a label. The file path is stored in a listbox. The function works, but it outputs the file size in bits, so I wrote the following to convert to more appropriate units, and it is now displaying only in...

Search for file in archive and load it into memory

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...

what's ARM TCM memory

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?....

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

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!")...

Looking into dynamic variables created using pointers?

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...

Good approach to clean application data programmmatically in Android

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...

System.Management, Management Object Searcher, and RAM

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...

sort runs out of memory

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...

Memory error in c++ (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...

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

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...

Does Python copy references to objects when slicing a list?

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:...

Not Used Recently (NUR) Page Replacement Algorithm [closed]

How to implement NUR (Not used recently page replacement algorithm) using any high level programming language (c, c++ or java)

Scrapy Memory Error (too many requests) Python 2.7

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 =...

C++11 Allocation Requirement on Strings

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...

Automate MySQL backup @localhost with mysqldump in Windows 8

I'm trying to set up a task in Windows 8 to automate my localhost db dump. I've created the task to run daily with the following command line: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe and parameters: --user=root --password=donttellya --result-file=dumped.sql mydb It works but doesn't terminate (running in the tasks list). Also, I'd...

^M behind operating system version?

I am currently writing a perl script to extract data from a log file and create statements using the data in a new file. In this new file, one particular data that I've extracted and used here is the operating system's version. It shows Windows XP Service Pack 3^M. I...