code
Mar 10, 2026CODE-009This Python application has a memory leak. Find it and explain the fix. ```python import threading import time from functools import lru_cache class EventProcessor: _instances = [] def __init__(self, name): self.name = name self.callbacks = [] self._lock = threading.Lock() EventProcessor._instances.append(self) def register_callback(self, func): self.callbacks.append(func) @lru_cache(maxsize=10000) def process(self, event_data): results = [] for callback in self.callbacks: result = callback(event_data) results.append(result) return tuple(results) def __del__(self): print(f"Processor {self.name} deleted") def create_processor_for_request(request_id): processor = EventProcessor(f"processor_{request_id}") processor.register_callback(lambda x: x.upper()) processor.register_callback(lambda x: len(x)) return processor # Simulated request handling def handle_request(request_id, data): processor = create_processor_for_request(request_id) return processor.process(data) # This runs for hours... for i in range(1000000): result = handle_request(i, f"event_data_{i}") time.sleep(0.001) ```
Winner
GPT-5.4
openrouter
9.54
WINNER SCORE
matrix avg: 8.07
10×10 Judgment Matrix · 89 judgments
OPEN DATA
| Judge ↓ / Respondent → | MiniMax M2.5 | Gemini 3.1 Pro | Grok 4.20 | GPT-5.4 | Claude Opus 4.6 | Claude Sonnet 4.6 | DeepSeek V4 | GPT-OSS-120B | Gemini 3 | MiMo-V2-Flash |
|---|---|---|---|---|---|---|---|---|---|---|
| MiniMax M2.5 | — | 6.8 | 8.4 | 10.0 | 8.8 | 8.6 | 8.6 | 8.6 | 8.0 | 8.0 |
| Gemini 3.1 Pro | 4.8 | — | 8.5 | 10.0 | 8.8 | 6.8 | 7.0 | 6.1 | 8.5 | 3.6 |
| Grok 4.20 | 6.5 | 5.8 | — | 9.0 | 7.5 | · | 6.6 | 8.8 | 7.8 | 6.0 |
| GPT-5.4 | 5.8 | 3.3 | 8.6 | — | 8.0 | 8.0 | 6.5 | 5.3 | 8.2 | 4.8 |
| Claude Opus 4.6 | 5.0 | 5.3 | 9.2 | 9.8 | — | 8.9 | 6.3 | 9.3 | 8.2 | 5.5 |
| Claude Sonnet 4.6 | 6.8 | 5.9 | 9.0 | 9.3 | 8.8 | — | 7.8 | 9.2 | 8.4 | 6.0 |
| DeepSeek V4 | 8.8 | 9.3 | 9.4 | 9.6 | 9.6 | 9.8 | — | 9.6 | 9.6 | 9.6 |
| GPT-OSS-120B | 8.2 | 5.5 | 8.6 | 8.8 | 8.6 | 8.1 | 7.5 | — | 8.6 | 7.5 |
| Gemini 3 | 9.6 | 9.3 | 10.0 | 10.0 | 10.0 | 10.0 | 9.2 | 9.8 | — | 6.8 |
| MiMo-V2-Flash | 8.6 | 8.4 | 9.8 | 9.3 | 9.2 | 9.3 | 8.6 | 9.3 | 8.8 | — |