Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Resource leaks due to an exception or error.

  1. #1
    Junior Member
    Join Date
    Sep 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Resource leaks due to an exception or error.

    I came across a project on Github (/mabrarov/exception-safety), which describes an approach to prevent resource leaks due to throwing an error or exception. Without throwing error/exception resource remains open.
    I would like to know how often you meet with the necessity of using similar approaches? How do you deal with the leaks in such cases? Have you ever encountered leaks like on the branch "case_example"?
    Last edited by seekerOfTruth; September 2nd, 2021 at 02:27 PM.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Resource leaks due to an exception or error.

    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Resource leaks due to an exception or error.

    Quote Originally Posted by Norm View Post
    Yes, that topic also was started by me. Did I break some rules?

Similar Threads

  1. How to diagnose memory leaks?
    By Ram Lakshmanan in forum Debugging Tutorials
    Replies: 0
    Last Post: March 28th, 2018, 02:36 AM
  2. Eclipse Error: Scanner resource leak
    By NorrinGalan in forum Java IDEs
    Replies: 3
    Last Post: February 7th, 2014, 05:27 AM
  3. Resource bundles, Code error
    By dpjmie in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 25th, 2013, 06:39 AM
  4. Memory Leaks in Java
    By tcstcs in forum Java Theory & Questions
    Replies: 1
    Last Post: January 9th, 2013, 09:34 AM
  5. Jsp Exception Error
    By toky in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: April 22nd, 2012, 05:04 PM