Heart attacks remain a leading cause of death worldwide, and early intervention is crucial for improving patient outcomes. However, current heart-attack detection systems are often slow $(> 15\min)$ and imprecise, leading to delays in treatment and a higher risk of mortality. In this study, we propose a novel approach to the early detection and prevention of heart attacks using memristor-based machine learning and plasmon-enhanced Raman spectroscopy with collapsible nanofinger. Our system offers a simple, low-cost, and rapid detection time of only 10 seconds, providing accurate warnings of silent heart-attack attempts ahead of actual attacks. By utilizing a memristor-based array for classification, we can harness the unique properties of memristors, including simultaneously improved speed and energy efficiency, to achieve high precision and accuracy above 90%, potentially in portable devices. Our demonstrations suggest that memristor-based machine learning has the potential to revolutionize heart attack detection and prevention, offering a promising new avenue for improving patient outcomes.