Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6db28942331d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9c22739d4489
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 29, 2015

  1. Copy the full SHA
    5af5d7d View commit details
  2. Copy the full SHA
    9c22739 View commit details
Showing with 10 additions and 8 deletions.
  1. +8 −6 core/src/main/java/org/jruby/Main.java
  2. +2 −2 core/src/main/java/org/jruby/Ruby.java
14 changes: 8 additions & 6 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -545,14 +545,16 @@ public static void printTruffleTimeMetric(String id) {
}

private static void printTruffleMemoryMetric() {
System.gc();
if (Options.TRUFFLE_METRICS_MEMORY_USED_ON_EXIT.load()) {
System.gc();

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}

System.err.printf("allocated %d%n", ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
System.err.printf("allocated %d%n", ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
}
}

private final RubyInstanceConfig config;
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -548,9 +548,9 @@ public void runFromMain(InputStream inputStream, String filename) {
return;
}

Main.printTruffleTimeMetric("before-parse");
Main.printTruffleTimeMetric("before-parse-initial");
ParseResult parseResult = parseFromMain(filename, inputStream);
Main.printTruffleTimeMetric("after-parse");
Main.printTruffleTimeMetric("after-parse-initial");

// if no DATA, we're done with the stream, shut it down
if (fetchGlobalConstant("DATA") == null) {