Skip to content

Commit

Permalink
Decrease ram usage (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin authored Jan 15, 2021
1 parent 390a570 commit e1beaee
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion czkawka_core/src/broken_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions czkawka_core/src/duplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 8 additions & 0 deletions czkawka_core/src/same_music.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 6 additions & 0 deletions czkawka_core/src/similar_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 4 additions & 0 deletions czkawka_core/src/zeroed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e1beaee

Please sign in to comment.