A NestJS service for data processing and optimization operations.
src/
├── main.ts # Application entry point
├── app.module.ts # Main application module
├── app.controller.ts # API controller with endpoints
└── memory-leak.service.ts # Data processor service
- Install dependencies:
npm install- Build the project:
npm run build- Run the server:
npm run devThe server will start on http://localhost:3000
GET /status- Service status checkGET /api/optimize- Run data processing optimization
curl http://localhost:3000/api/optimizeResponse:
{
"status": "success",
"itemsProcessed": 100000,
"details": "976.56MB cached"
}The /api/optimize endpoint processes data and caches results for performance optimization. Each request processes a large dataset and stores it in memory for quick access on subsequent requests.