memory rapidly reducing and copy paste problem since using ditto command in terminal

ghazal_slmi

macrumors newbie
Original poster
Feb 26, 2018
4
0
hi, I used sudo ditto command in terminal to copy a folder. I saw that nothing was being copied in the paths I chose and I quit terminal while it was still doing the ditto... I didn't know how to terminate the command itself. ever since my memory is rapidly lowering. for example it is 15.46 gb available now and 5 minutes later it will be 15.41.

I found out that I mistyped the paths in ditto command and the folders were copied in my volumes folder. deleted them but still the same problem. I checked activity monitor but there is no ditto task but my kernel_task is taking up 790 mb. I restarted my pc and deleted terminal.plist from library preferences but no help.

another problem that I noticed ever since ditto is that copy paste function is not working right. for example I copy a 4 gb file and paste it in another path. it will be pasted but memory will not change, like no 4 gb has been copied but the file is actually copied. when I download things or compress files however available memory will change but copy paste files won't make any change. I could even copy a 25 gb file although my available space is about 15 gb...

pleaaase help me, this is driving me crazy!
 
Last edited:

darkpaw

macrumors 6502
Sep 13, 2007
309
185
London, England
Is your drive using APFS? (If you're on High Sierra and you have a built-in SSD, then it should've been converted during the install.) If you select your hard drive and press Cmd+I, the Get Info window should show "Format: APFS".

I ask, because one of the features of APFS is that simple duplications of files do not take up any extra space, as there's already a copy of it on the drive.

Have you rebooted your machine? That will definitely terminate every process, so the kernel shouldn't use increasing amounts of RAM.
 
  • Like
Reactions: ghazal_slmi

ghazal_slmi

macrumors newbie
Original poster
Feb 26, 2018
4
0
Is your drive using APFS? (If you're on High Sierra and you have a built-in SSD, then it should've been converted during the install.) If you select your hard drive and press Cmd+I, the Get Info window should show "Format: APFS".

I ask, because one of the features of APFS is that simple duplications of files do not take up any extra space, as there's already a copy of it on the drive.

Have you rebooted your machine? That will definitely terminate every process, so the kernel shouldn't use increasing amounts of RAM.
hi, sorry for the late reply. I still have the problem though and I will appreciate if you could help me. I checked the hard drive and it is APSF. do you mean this copy paste issue is normal? I currently have 20 GB available space and when I copy a 30 GB file that is in my pc, it is immediately done and takes only about 2 KB. after the copying finishes and I check the file size it is 30 GB. how is this possible? I mean I have only 20 GB available and 30 GB is copied! my available space is still 20 GB after copying... is this normal? I don't know anything about APFS. however when I copy a 2 gb file from an external drive or download something my memory is decreased by the amount of that file's size.
I thought the ditto command caused this issue, but maybe upgrading to High Sierra caused this. I don't remember if my mac had this issue before using the ditto command. maybe it happened after I upgraded to high sierra but only noticed it after using ditto and checking the memory. but I'm sure it didn't have the issue when I had El Capitan.
And what about the little changes in memory? every 10-15 minutes I notice about 0.1 GB is decreased. sometimes when I restart the pc it changes back but sometimes not...
 
Last edited:

Fishrrman

macrumors P6
Feb 20, 2009
17,182
5,536
"I used sudo ditto command in terminal to copy a folder."

Something here I don't quite understand. Please explain:
Why use a terminal command to copy a folder, when you can just do it in the finder?
 

ghazal_slmi

macrumors newbie
Original poster
Feb 26, 2018
4
0
"I used sudo ditto command in terminal to copy a folder."

Something here I don't quite understand. Please explain:
Why use a terminal command to copy a folder, when you can just do it in the finder?
because I wanted to fully merge a folder inside another folder with the same name. copying in Finder erases the existing folder and deletes all the previous files. even holding the option key doesn't help. you have to do it manually which can be very tedious if there are lots of different files inside of them. ditto command can do this properly though.
 

casperes1996

macrumors 68040
Jan 26, 2014
3,954
1,903
Horsens, Denmark
hi, sorry for the late reply. I still have the problem though and I will appreciate if you could help me. I checked the hard drive and it is APSF. do you mean this copy paste issue is normal? I currently have 20 GB available space and when I copy a 30 GB file that is in my pc, it is immediately done and takes only about 2 KB. after the copying finishes and I check the file size it is 30 GB. how is this possible? I mean I have only 20 GB available and 30 GB is copied! my available space is still 20 GB after copying... is this normal? I don't know anything about APFS. however when I copy a 2 gb file from an external drive or download something my memory is decreased by the amount of that file's size.
I thought the ditto command caused this issue, but maybe upgrading to High Sierra caused this. I don't remember if my mac had this issue before using the ditto command. maybe it happened after I upgraded to high sierra but only noticed it after using ditto and checking the memory. but I'm sure it didn't have the issue when I had El Capitan.
And what about the little changes in memory? every 10-15 minutes I notice about 0.1 GB is decreased. sometimes when I restart the pc it changes back but sometimes not...

I can't answer the part about your storage space decreasing, but your copy&paste is regular APFS behaviour. It's a feature called copy-on-write that some advanced file systems have.

When you copy a file that already exists on the hard drive/SSD, the file table will copy not the contents of the file, but only a reference to where the contents is stored. The moment you change the data in the copy though that data is written separately.
 
  • Like
Reactions: ghazal_slmi

ghazal_slmi

macrumors newbie
Original poster
Feb 26, 2018
4
0
I can't answer the part about your storage space decreasing, but your copy&paste is regular APFS behaviour. It's a feature called copy-on-write that some advanced file systems have.

When you copy a file that already exists on the hard drive/SSD, the file table will copy not the contents of the file, but only a reference to where the contents is stored. The moment you change the data in the copy though that data is written separately.
Thank you! I read an article about APFS and I figured out how it works. it's very interesting!
most of the times when I restart my pc the decreased amount of memory is back. I don't know why this happens but it's not very serious, I can live with that ;) it was the copy/paste issue that really annoyed me and now I know it's not a problem. Thanks again!
 

casperes1996

macrumors 68040
Jan 26, 2014
3,954
1,903
Horsens, Denmark
Thank you! I read an article about APFS and I figured out how it works. it's very interesting!
most of the times when I restart my pc the decreased amount of memory is back. I don't know why this happens but it's not very serious, I can live with that ;) it was the copy/paste issue that really annoyed me and now I know it's not a problem. Thanks again!
Sounds like a swap file issue or a tmp/ problem, but that's all I can say.

Happy to help clear up the confusion with APFS though. It's quite a good file system, although not at all recommended on spinning disks or disks containing crucial data, since A) It's slow as hell on spinners due to the copy-on-write and the way spinners work. And 2) It's a relatively new file system so data recovery software for it is sparse or non-existent. I imagine that's why even Time Machine still runs on HFS+ - since it's backup
 
  • Like
Reactions: ghazal_slmi