Monday, 4 July 2016

Java Tutorial : Java Exception handling (OutOfMemoryError)

Click here to watch in Youtube :

Click the below Image to Enlarge
Java Tutorial : Java Exception handling (OutOfMemoryError)
import java.util.LinkedList;

public class OutOfMemoryErrorDemo

    public static void main(String[] args)
        String str = "Peter";
        LinkedList<String> linkedList = new LinkedList<String>();   
            str=str+" Welcome to India";

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
        at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
        at java.lang.AbstractStringBuilder.append(Unknown Source)
        at java.lang.StringBuilder.append(Unknown Source)
        at OutOfMemoryErrorDemo.main(
Click the below link to download the code:

Github Link:

Bitbucket Link:

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • No comments:

    Post a Comment

    Google+ Followers

    Google+ Badge