1
0
Fork 0
mirror of synced 2024-04-27 17:22:13 +12:00

Decrease ram usage (#212)

This commit is contained in:
Rafał Mikrut 2021-01-15 12:41:45 +01:00 committed by GitHub
parent 390a570833
commit e1beaeed28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 1 deletions

View file

@ -443,7 +443,7 @@ impl BrokenFiles {
Common::print_time(system_time, SystemTime::now(), "sort_images - reading data from files in parallel".to_string());
// Clean data
// Clean unused data
self.files_to_check = Default::default();
true

View file

@ -923,6 +923,10 @@ impl DuplicateFinder {
}
Common::print_time(start_time, SystemTime::now(), "check_files_hash - full hash".to_string());
// Clean unused data
self.files_with_identical_size = Default::default();
true
}

View file

@ -402,6 +402,10 @@ impl SameMusic {
self.music_entries = vec_file_entry;
Common::print_time(start_time, SystemTime::now(), "check_records_multithreaded".to_string());
// Clean for duplicate files
self.music_to_check.clear();
true
}
fn check_for_duplicates(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&futures::channel::mpsc::Sender<ProgressData>>) -> bool {
@ -589,6 +593,10 @@ impl SameMusic {
progress_thread_handle.join().unwrap();
Common::print_time(start_time, SystemTime::now(), "check_for_duplicates".to_string());
// Clear unused data
self.music_entries.clear();
true
}

View file

@ -527,6 +527,12 @@ impl SimilarImages {
self.similar_vectors = new_vector;
Common::print_time(hash_map_modification, SystemTime::now(), "sort_images - selecting data from BtreeMap".to_string());
// Clean unused data
self.image_hashes = Default::default();
self.images_to_check = Default::default();
self.bktree = BKTree::new(Hamming);
true
}

View file

@ -385,6 +385,10 @@ impl ZeroedFiles {
self.information.number_of_zeroed_files = self.zeroed_files.len();
Common::print_time(start_time, SystemTime::now(), "search for zeroed_files".to_string());
//Clean unused data
self.files_to_check.clear();
true
}