Tuesday Feb 17, 2015

Welcome Raspberry Pi 2!

Having surpassed 4 million units shipped and clearly establishing itself as a de facto reference platform, the folks at the Raspberry Pi Foundation are not resting on their laurels.  Earlier this month (February 2015), they introduced the Raspberry Pi 2 Model B:

Compared to its predecessor, the Raspberry Pi B+, this newer model is packaged with a Broadcom BCM2836 SoC at 900MHz.  It is not only superior in performance to the original single core BCM2835 processor on core-by-core basis, it now brings the added benefit of including 4 cores.  Add to that a doubling of RAM from 512MB to 1GB and it should be no mystery that this new platform can handle more serious workloads.  Later on down, a chart compares the SPECjvm2008 benchmark performance of the original Raspberry Pi Model B with the new Raspberry Pi 2 Model B.

In addition to the substantial performance bump, major kudos are to be given to the Raspberry Pi Foundation engineers for their focus on hardware and software compatibility:

  • The Pi2 maintains the same physical form factor as the Raspberry Pi B+, meaning that all of the previous accessories (USB power cable, serial console cable, microSD card ...) all work perfectly well with the new version.  That also includes any Raspberry Pi B+ enclosures you may have too.
  • The ARMv7-based BCM2836 processor is backwards-compatible with the original ARMv6 version.  In order to maintain binary compatibility, the latest version of the Raspbian distribution will boot either the new or old versions of the Raspberry Pi.  Note that in this mode, applications will not be able to take full advantage of the ARMv7 enhancements.  Alternate OS distributions may provide the extra performance boost at the expense of breaking backwards compatibility.
  • Perhaps best of all, the Raspberry Pi maintains its appeal to the masses.  At approximately £23/$35, no price increase comes along with this upgrade.

A Brief Look at Performance

The chart that follows examines Raspberry Pi Java performance via the SPECjvm2008 benchmark.  Both original and Raspberry Pi 2 systems ran the latest available Raspbian Image (2015-02-02) and the latest available Java 7 JDK (Java 7 update 72)1.  The four vertical bars (blue, red, green, purple) represent four separate runs of the benchmark:

  1. Blue: Raspberry Pi Model B.  Invoked with JVM argument -Xmx400m specifying a maximum heap of 400MB.
  2. Red: Raspberry Pi 2, single threaded.  Invoked with JVM argument -Xmx400m specifying a maximum heap of 400MB, and application argument -bt 1 instructing the SPECjvm2008 test harness to run the benchmark tests with a single thread.  This is meant to approximate an apples-to-apples comparison of single core performance between the two Raspberry Pi systems.
  3. Green: Raspberry Pi 2, multithreaded (default).  Invoked with JVM argument -Xmx600m specifying a maximum heap of 600MB2.
  4. Purple: Raspberry Pi 2, multithreaded (default), larger heap.  Invoked with JVM argument -Xmx900m specifying a maximum heap of 900MB3.


The larger the measurement (ops/min), the faster the result, the single core performance of the Raspberry Pi 2 is a big improvement over its predecessor.  As the SPECjvm2008 suite does include a healthy dose of mutithreaded code, enabling the test harness to take advantage of the 4 hardware threads available to the Pi 2 added another huge jump in performance.  And finally utilizing the extra RAM (in the form of a larger heap) provided for by the Raspberry Pi 2 yields only a very modest gain in throughput.  In particular, 2 of the 11 component tests (compress, xml) show an improvement with the extra heap.  For more detailed results, you can view this spreadsheet.

The added horsepower that the Raspberry Pi 2 brings solidifies the Raspberry Pi family as an important reference platform in the present as well as the future for companies like Oracle.  As the Internet of Things phenomena plays out and more processing is brought to the edge, the new Raspberry Pi is better suited to handle the increased workload that applications like Oracle Event Processing for Oracle Java Embedded and others require.

Notes

1 The latest Raspbian distro includes a recent version of Oracle's Java 8 JDK.  Unfortunately the somewhat dated SPECjvm2008 benchmark has a dependency that requires Java 1.7 or earlier, so for these benchmarks, we needed to use a Java 7 JDK.  The latest available, 7u72, was used for these tests.

2 With 4 cores, the SPECjvm2008 test suite would produce an OutOfMemoryError when run with the initial max heap size argument of -Xmx400m.  Increasing the max heap size to 600MB (-Xmx600m) enabled the tests to complete.  Evidently SPECjvm2008 requires more heap space as more hardware threads are configured in.

3 In order to utilize the full amount of RAM (1GB) available with the Raspberry Pi 2, a firmware upgrade may be required.  If necessary, you can invoke 'sudo rpi-update'  from a linux shell on the Raspberry Pi 2 to accomplish this task.

Monday Oct 14, 2013

Oracle Java Now Part of Raspberry Pi Raspian Distribution

Having sold more than 1.75 million units in its brief lifespan, there is no denying the profound impact the Raspberry Pi has had on the embedded development community.  Amid all the hoopla surrounding the recently completed Oracle OpenWorld and Java One events, one announcement that flew under the radar dealt with the fact that the Oracle JDK is now part of the Raspberry Pi Raspian distribution.

This means that by default, when you download and install the latest Raspian distribution on your Raspberry Pi, the Oracle Java runtime environment and development tools are automatically part of the list of packages installed.  Here's a screenshot showing a login session to a Raspberry Pi running the 2013-09-25-wheezy-raspian distribution.  The JDK is installed as the oracle-java7-jdk package and is utilizing the Java 7u40 release.

For those who either cannot or do not wish to perform an entire Raspian upgrade, the Oracle JDK is available via the following command:

$ sudo apt-get update && sudo apt-get install oracle-java7-jdk

Great news.

Saturday Dec 22, 2012

A Raspberry Pi / JavaFX Electronic Scoreboard Application

As evidenced at the recently completed JavaOne 2012 conference, community excitement towards the Raspberry Pi and its potential as a Java development and deployment platform was readily palpable.  Fast forward three months, Oracle has announced the availability of a JDK 8 (with JavaFX) for Arm Early Access Developer Preview where the reference platform for this release is none other than the Raspberry Pi.

What makes this especially interesting to me is the addition of JavaFX to the Java SE-Embedded 8 platform.  It turns out that at $35US, the (not so) humble Raspberry Pi has a very capable graphics processor, opening up a Pandora's box of graphics applications that could be applied to this beloved device.  As a first step in becoming familiar with just how this works, I decided to dust off a two year old JavaFX scoreboard application, originally written for a Windows laptop, and see how it would run on the Pi.  Low and behold, the application runs unmodified (without even a recompile).

The video that follows shows how an ordinary flat screen TV can be converted into a full screen electronic scoreboard driven by a Raspberry Pi.  The requirements for such a solution are incredibly straightforward: (1) the TV needs access to a power receptacle and (2) it must be within range of a WiFi network in order to receive scoreboard update packets.  The device is so compact and miserly from a power perspective, that we velcro the Pi to the back of the TV and get our power from the TV's USB port. If you can spare a few moments, it just might be worth your while to take a look.



About

Jim Connors-Oracle

Search

Categories
Archives
« May 2015
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today