public static void main()

in application/org.openjdk.jmc.joverflow/src/main/java/org/openjdk/jmc/joverflow/Main.java [102:174]


	public static void main(String args[]) throws Exception {
		System.err.println("JOverflow version " + VERSION);

		ArrayList<String> dumpFileNames = new ArrayList<>();
		ArrayList<String> classpath = new ArrayList<>();

		for (String arg : args) {
			if (arg.charAt(0) == '-') {
				if (arg.equals("-help")) {
					System.out.println(USAGE);
				} else if (arg.equals("-verbose")) {
					verbose = true;
				} else if (arg.equals("-full_obj_histo")) {
					printFullObjectHistogram = true;
				} else if (arg.startsWith("-ref_chain_depth=")) {
					printedRefChainDepth = parseNumericFlag(arg);
				} else if (arg.startsWith("-ref_chain_stoppers=")) {
					refChainStopperClassPrefixes = parseCommaSeparatedStringsFlag(arg);
				} else if (arg.startsWith("-pointer_size=")) {
					explicitPointerSize = parseNumericFlag(arg);
				} else if (arg.equals("-use_mmap")) {
					useMmap = true;
				} else if (arg.equals("-depth_first") || arg.equals("-dfs")) {
					useBreadthFirst = false;
				} else if (arg.equals("-breadth_first") || arg.equals("-bfs")) {
					useBreadthFirst = true;
				} else if (arg.equals("-long_lived_strings")) {
					findLongLivedStrings = true;
				} else if (arg.startsWith("-print_string_fields_to_intern=")) {
					stringsToInternTextFile = parseFileNameFlag(arg);
				} else {
					System.err.println("Unknown flag: " + arg);
					System.exit(-1);
				}
			} else {
				if (arg.endsWith(".txt")) {
					File jarListFile = FileUtils.fileExistsAndReadableOrExit(arg);
					classpath.addAll(FileUtils.readTextFile(jarListFile));
				} else if (arg.endsWith(".jar")) {
					classpath.add(arg);
				} else {
					FileUtils.fileExistsAndReadableOrExit(arg);
					dumpFileNames.add(arg);
				}
			}
		}

		if (dumpFileNames.isEmpty()) {
			System.err.println("No dump file specified");
			System.exit(-1);
		}

		VerboseOutputCollector vc = new VerboseOutputCollector();

		if (findLongLivedStrings) {
			// This is a highly experimental thing, may be removed any time
			if (dumpFileNames.size() <= 1) {
				System.err.println("-string_fields_to_intern requires more than one dump file");
				System.exit(-1);
			}
			generateLongLivedStringsReport(dumpFileNames, vc);
		} else {
			if (dumpFileNames.size() > 1) {
				System.err.println("More than one dump file specified: " + dumpFileNames);
				System.exit(-1);
			}
			String fileName = dumpFileNames.get(0);
			checkFileAndGetSize(fileName);

			Snapshot snapshot = readSnapshot(fileName, vc);
			generateStandardReport(snapshot, classpath);
		}
	}