Large arrays make runtime very slow
First I must encourage you to follow java conventions. Local variables and methods should be typed in lowerCamelCase. You shouldn't also assign a variable twice if you can avoid it for example you shouldn't do this 


List&lt;String&gt; DBpediaClassesArray = new ArrayList&lt;String&gt;();
DBpediaClassesArray = new ArrayList&lt;String&gt;( ClassesRetrieval.getDBpediaClasses());



You could also guive a better name to this variable, the array sufix isn't doing much there, I would prefer dbpediaClasses.
You should do this instead:

List&lt;String&gt; dbpediaClasses= new ArrayList&lt;String&gt;( ClassesRetrieval.getDBpediaClasses());


About your implementation:

You are in the wrong path! It seems to me that you aren't writing code in the simplest way to achieve the expected behaviour. You are creating way to many maps in order to simply find a max number of intersections. 

I wouldn't put my hands on fire for it, because I can't test it, but I think that your code is equivalent to this:

public static void getNdMatches() throws IOException{
    List&lt;String&gt; dbpediaClasses = new ArrayList&lt;String&gt;( ClassesRetrieval.getdbpediaClasses());
    List&lt;String&gt; yagoClasses = new ArrayList&lt;String&gt;( ClassesRetrieval.fileToArrayListYago());
    HashMap&lt;String, Set&lt;String&gt;&gt; cachedYagos = new HashMap&lt;String, Set&lt;String&gt;&gt;();
    String yagoClassWithMaxMatches="";

    for(String dbClass:dbpediaClasses){
      int max = 0;
      Set&lt;String&gt; dbClassSet = Sets.newHashSet(GetDBpediaClassInstances(dbClass));
      for(String yagoClass:yagoClasses){
          Set&lt;String&gt; yagoSet = cachedYagos.get(yagoClass);
          if(yagoSet == null){
            yagoSet = Sets.newHashSet(GetYagooClassInstances(yagoClass);
            cachedYagos.put(yagoClass, yagoSet);
          }
          Set&lt;String&gt; IntersectionSet = Sets.intersection(dbClassSet, yagoSet);
          if(IntersectionSet.size() &gt; max){
            max = IntersectionSet.size();
            yagoClassWithMaxMatches = yagoClass
          }
      }
      if(max == 0){
          System.out.println(dbClass+" Corresponds to nothing");
      }else{
          System.out.println(dbClass+" Corresponds to "+ yagoClassWithMaxMatches+" with : "+max);
      }   
    }  
}