Firstly, don't use an InputStream when you have a File object! Using an InputStream means POI has to buffer you whole thing into memory, while with a File it can leave it on disk until needed. As covered in the POI documentation, instead open with:
OPCPackage pkg = OPCPackage.open(new File("file.xlsx"));
Secondly, you seem to be opening up the whole Excel structure and parsing that into memory, when all you want is the metadata. Don't! Firing up XSSFWorkbook takes quite a lot of processing and memory, which you don't need if all you care about is metadata, which lives in a separate area of the file
Instead, just load the properties themselves, and work with that. Your final code would be something like:
OPCPackage pkg = OPCPackage.open(new File("file.xlsx"));
POIXMLProperties props = new POIXMLProperties(pkg);
System.out.println("The title is " + props.getCorePart().getTitle());
That ought to load in only a fraction of the file's total size as memory use