triggerGC method

Future<void> triggerGC()

触发垃圾回收 (仅Android)

Implementation

Future<void> triggerGC() async {
  if (!Platform.isAndroid) return;

  try {
    await _channel.invokeMethod('triggerGC');
    if (kDebugMode) {
      debugPrint('🗑️ Garbage collection triggered');
    }
  } catch (e) {
    if (kDebugMode) {
      debugPrint('❌ Failed to trigger GC: $e');
    }
  }
}