watcher
watcher copied to clipboard
High memory usage when watching on large folder
Hi team, I see that this console app costs ~1GB of Memory while running, is this as expected?
Dart SDK version: 2.12.0-29.0.dev (dev) (Mon Nov 9 06:42:00 2020 -0800) on "macos_x64"
import 'package:watcher/watcher.dart';
void main(List<String> arguments) async {
final watcher = DirectoryWatcher('/Users/home/FolderWithMillionsOfFiles');
watcher.events.listen((event) async {
print('File ${event.type}: ${event.path}');
});
await Future.delayed(Duration(days: 1));
}
pubspec.yaml
name: file_watcher
description: A simple command-line application.
# version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.10.0 <3.0.0'
dependencies:
watcher: ^0.9.7+15
dev_dependencies:
pedantic: ^1.9.0
Thanks.