Skip to content

Add ProcessorBenchmark to measure simulation time and memory footprint for cloudsimplus#595 (before) - #12

Merged
manoelcampos merged 1 commit into
masterfrom
processor-benchmark-pe-list
Oct 25, 2026
Merged

manoelcampos merged 1 commit into
masterfrom
processor-benchmark-pe-list

Conversation

@manoelcampos

@manoelcampos manoelcampos commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds ProcessorBenchmark, which measures the simulation time and memory footprint reduction from cloudsimplus/cloudsimplus#595 (#592). That PR replaced the List<Pe> of Hosts (one object per CPU core) with a single Processor that just counts the cores.

This PR uses the CloudSim Plus API before #595, to get the "before" numbers. master was reset to the commit before #11 so this benchmark could be added with the old API. After this PR is merged, #11 will be restored on master, and a follow-up PR moves the benchmark to the new API with the "after" numbers.

What it measures

  • Heap retained by each Host and VM, with 1, 8, 32 and 128 cores.
  • Heap retained by a whole scenario (1,000 Hosts × 32 cores, 4,000 VMs × 8 cores, 8,000 Cloudlets × 4 cores), before and after running it.
  • Time to run that scenario: the median of 5 runs after 2 warmup runs.

The memory values are the median of 5 rounds. Hosts and VMs are created only by ProcessorScenario.newHost()/newVm(), so moving to the new API changes only those two methods.

New HeapMeter

It reads the live heap from a class histogram (the same as jcmd <pid> GC.class_histogram), instead of the used heap after System.gc().

With CloudSim Plus after #595, the used heap read that way alternated between rounds. Objects from the previous round were sometimes still counted, which gave values such as 12 bytes per Host. The class histogram counts only reachable objects, so the results are stable with any GC.

Results (before cloudsimplus/cloudsimplus#595)

CloudSim Plus built from 9bb9de25c (installed locally), JDK 25.0.4, default GC, -Xmx4g:

Heap retained by each machine (bytes), median of 5 rounds with 10,000 objects:
  Cores |   HostSimple |     VmSimple
      1 |        940.6 |        883.3
      8 |      1,807.1 |        891.9
     32 |      4,804.7 |        883.6
    128 |     16,722.2 |        883.1

Scenario: 1,000 Hosts with 32 cores, 4,000 VMs with 8 cores, 8,000 Cloudlets with 4 cores
  Heap retained by the scenario before running it: 9.6 MB
  Heap retained by the scenario after running it:  12.2 MB
  Simulation time: 1.691 seconds (median of 5 runs after 2 warmup runs)

A Host grows about 123 bytes per core, because each core is a PeSimple object.

How to run it

git -C ../cloudsimplus checkout 9bb9de25c
(cd ../cloudsimplus && ./mvnw install -DskipTests)
./mvnw clean package
java -Xmx4g -cp target/cloudsimplus-benchmarks-*-uber.jar org.cloudsimplus.benchmarks.ProcessorBenchmark

CI: it compiles only against CloudSim Plus before #595. The published 9.0.0-SNAPSHOT already has #595, so the CI build is expected to fail on this PR.

🤖 Generated with Claude Code

@manoelcampos manoelcampos self-assigned this Oct 25, 2026
…t for cloudsimplus#595

It uses the CloudSim Plus API before cloudsimplus#595 (a List<Pe> per Host),
to get the numbers before that change. It measures the heap retained by
Hosts and VMs with different numbers of cores and by a whole simulation
scenario (before and after running it), and the time to run that scenario.

HeapMeter reads the live heap from a class histogram, since the used heap
after System.gc() may include objects not collected yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manoelcampos
manoelcampos force-pushed the processor-benchmark-pe-list branch from fb9aae1 to 6ac41ce Compare October 25, 2026 01:22
@manoelcampos
manoelcampos merged commit 19064fb into master Oct 25, 2026
1 check passed
@manoelcampos
manoelcampos deleted the processor-benchmark-pe-list branch October 25, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant