ISC2 Certified Secure Software Lifecycle Professional (CSSLP) Practice Question

During a code review of a Java-based file-processing microservice, you notice a method that opens a FileInputStream for every request but never closes the stream. After several hours of heavy traffic the container repeatedly crashes with the error "Too many open files." Which code change BEST prevents this security risk in accordance with secure resource-management practices?

  • Move the file-reading logic into a separate microservice so the main API thread pool is protected.

  • Increase the operating system's maximum open-file descriptor limit to accommodate more simultaneous streams.

  • Use a try-with-resources construct (or a finally block) to ensure the FileInputStream is always closed after use.

  • Wrap access to the FileInputStream in a synchronized block to avoid concurrent access issues.

ISC2 Certified Secure Software Lifecycle Professional (CSSLP)
Secure Software Implementation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot