disk

Calculate Total disk i/o by a single process

假如想象 提交于 2019-12-03 15:24:55
I am looking for some tool that will dump total disk I/O by a single process after it ends. So far my finding is :- iotop = It shows i/o per process in real time but does not give total after process end. iostat = It shows real time I/O but does not tell process For example , I have some process running in background with PID ####. I need the Total Bytes Written and Read by that process in total after the process ends.Can anybody tell how I can extract this information given a process PID. Feel free to play with this scribble (myio.sh): #!/bin/bash TEMPFILE=$(tempfile) # create temp file for

Flush disk write cache from Windows CLI

孤人 提交于 2019-12-03 10:38:23
Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line? I found the SysInternals Sync worked well for me - although it flushes ALL cache, not just for the specific folder. Example of usage: IF EXIST Output RD /S /Q Output && Sync && MD Output By default it flushes all cached data for all drives - you can specify command-line options to restrict which drives but you cannot restrict it to just specific folders. Without it I would often get Access denied errors because

UIImagePickerController run out of memory with camera source

大城市里の小女人 提交于 2019-12-03 08:00:25
问题 I got a big performance issue using UIImagePickerController and saving the image on disk. I can't figure out what I am doing wrong. Here is my code: - (void)imagePickerController:(UIImagePickerController *)pick didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; iPixAppDelegate *delegate = (iPixAppDelegate *)[[UIApplication sharedApplication

Memory mapped - partially disk based algorithms

百般思念 提交于 2019-12-03 07:44:34
问题 Are there any good resources or books for spillable data structures, that is, say, a queue? When storing large objects it could fill up all of memory, but if you can keep, say, the most used items of that queue structure in memory and the rest on disk (sort of like paging). Similarly, this question applies to other structures such as linked lists, arrays, hashtables and so on. 回答1: What you are looking for might be the topic of I/O efficient algorithms. A Google search didn't turn up any

How can I record what process or kernel activity is using the disk in GNU/Linux?

我只是一个虾纸丫 提交于 2019-12-03 06:51:15
问题 On a particular Debian server, iostat (and similar) report an unexpectedly high volume (in bytes) of disk writes going on. I am having trouble working out which process is doing these writes. Two interesting points: Tried turning off system services one at a time to no avail. Disk activity remains fairly constant and unexpectedly high. Despite the writing, do not seem to be consuming more overall space on the disk. Both of those make me think that the writing may be something that the kernel

In Python, how do I check if a drive exists w/o throwing an error for removable drives?

五迷三道 提交于 2019-12-03 06:39:53
Here's what I have so far: import os.path as op for d in map(chr, range(98, 123)): #drives b-z if not op.isdir(d + ':/'): continue The problem is that it pops up a "No Disk" error box in Windows: maya.exe - No Disk: There is no disk in the drive. Please insert a disk into drive \Device\Harddisk1\DR1 [Cancel, Try Again, Continue] I can't catch the exception because it doesn't actually throw a Python error. Apparently, this only happens on removable drives where there is a letter assigned, but no drive inserted. Is there a way to get around this issue without specifically telling the script

NodeJS How do I Download a file to disk from an aws s3 bucket?

我怕爱的太早我们不能终老 提交于 2019-12-03 02:18:24
问题 My goal: Display a dialog box prompting the user to save a file being downloaded from aws. My problem: I am currently using awssum-amazon-s3 to create a download stream. However I've only managed to save the file to my server or stream it to the command line... As you can see from my code my last attempt was to try and manually set the content disposition headers which failed. I cannot use res.download() as the headers have already been set? How can I achieve my goal? My code for node: app

How to purge disk I/O caches on Linux?

大兔子大兔子 提交于 2019-12-03 01:28:37
问题 I need to do it for more predictable benchmarking. 回答1: Sounds like you want the sync command, or the sync() function. If you want disk cache flushing: echo 3 | sudo tee /proc/sys/vm/drop_caches 回答2: You can do it like this: # sync # (move data, modified through FS -> HDD cache) + flush HDD cache # echo 3 > /proc/sys/vm/drop_caches # (slab + pagecache) -> HDD (https://www.kernel.org/doc/Documentation/sysctl/vm.txt) # blockdev --flushbufs /dev/sda # hdparm -F /dev/sda # NEXT COMMAND IS NOT FOR

UIImagePickerController run out of memory with camera source

假装没事ソ 提交于 2019-12-02 21:30:51
I got a big performance issue using UIImagePickerController and saving the image on disk. I can't figure out what I am doing wrong. Here is my code: - (void)imagePickerController:(UIImagePickerController *)pick didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; iPixAppDelegate *delegate = (iPixAppDelegate *)[[UIApplication sharedApplication] delegate]; [delegate addPicture:imageData]; } The addPicture method creates a new picture object that

Memory mapped - partially disk based algorithms

时光毁灭记忆、已成空白 提交于 2019-12-02 21:11:41
Are there any good resources or books for spillable data structures, that is, say, a queue? When storing large objects it could fill up all of memory, but if you can keep, say, the most used items of that queue structure in memory and the rest on disk (sort of like paging). Similarly, this question applies to other structures such as linked lists, arrays, hashtables and so on. What you are looking for might be the topic of I/O efficient algorithms. A Google search didn't turn up any books for me, but this course page contains a list of articles which may or may not be relevant for you. You