C H A P T E R  2

Hardware and Software Requirements and Constraints

You can build Java Wireless Client software on Microsoft Windows or Linux.

Get started with a self-hosted build, which means you build, run, and debug the software on the same machine. This is a great way to get acquainted with the build system and structure of Java Wireless Client software.

Later, you cross-compile, which is building on one platform but running on another. For example, you could use a desktop Linux machine to build executables for the ARM-based Texas Instruments OMAP730 development board.

Java Wireless Client software contains reference ports to the Microsoft Windows platform and the Texas Instruments OMAP730 development board. The host development environment for building the OMAP730 implementation is a Linux system running on x86 hardware. This chapter lists some requirements and constraints of the reference ports and the development environment. The Release Notes contain additional information.

The source code makes some assumptions about the capabilities of the development environment and the port's target device. In addition, because Java Wireless Client software is designed for small devices, it has resource constraints that this chapter describes.

In addition to the Java Wireless Client software source distribution, the CLDC HotSpottrademark Implementation, Version 2.0 source distribution is required to create a complete Java Technology for the Wireless Industry software implementation for the target device.


Data-Type Assumptions

The native code in the Java Wireless Client software expects some data types to be specific sizes, as follows:

Native code might behave unpredictably if the platform does not satisfy these expectations.


Resource Limitations

Java Wireless Client software is intended to run on resource-constrained devices. Unlike a desktop or server system, available memory and persistent storage are limited. Some devices quit when excess native resources are requested.

This section lists areas in which you can limit resources in the initial phase of your port. The section contains possibilities, not an exhaustive list, of all the resources Java Wireless Client software could use or consume. Consult the MIDP specification for details.

Native Stack Size

The CLDC HotSpot implementation uses a single stack (a primordial stack) to run native code. To conserve runtime memory, try to define the stack size to match your target platform.

A Java Wireless Client software binary is a normal executable produced by your target platform's tool chain just like other native binaries. Java Wireless Client software uses the default C stack provided by the tool chain as its primordial stack.

Whether you can change the default stack size, and how you change it, depends on your build tools and your target device's operating system. See your tool and device documentation for information.

If you can change the stack size, its minimum size depends on a number of factors, such as the type and complexity of Java ME technology applications that your port will run, and the stack usage of your device's native functions. A stack size that is too small can lead to stack corruptions.



Tip - On the ARM platform, typical game MIDlets require between 5 kilobytes and 6 kilobytes of primordial stack to run reliably. Adding a safety margin of 2 kilobytes makes the minimum stack size 8 kilobytes.



AMS Resource Limitations

You can set the following values used by the application management system:

RMS Resource Limitations

In brief, the current limitations are as follows:

Java Wireless Client software limits suite storage size, which is the common space available for MIDlet suites and their record stores. The maximum RMS record store size is separately limited by the RMS implementation.

If the system.jam_space property is set, it is used as the maximum space for MIDlet suites and their record stores. This property is defined here:

midp/src/configuration/configuration_xml/share/properties.xml

The default value for system.jam_space is 1,000,000 bytes.

If system.jam_space is not defined, then DEFAULT_TOTAL_SPACE is used. This value is defined here:

midp/src/core/storage/reference/native/midpStorage.c

The default value for DEFAULT_TOTAL_SPACE is 4 megabytes.

The maximum size for record stores per MIDlet suite is defined by the constant STORAGE_SUITE_LIMIT, which can be different for each platform. This constant is defined here:

midp/src/configuration/configuration_xml/platform/constants.xml

The default value is 200,000 bytes.

The amount of additional room available for a record store to grow is returned by RecordStore.getSizeAvailable(). This value is limited as follows:

min(INT_MAX, realAvailableSize)

This is important when removable media is used for storing the RMS files.

Networking Resource Limitations

The networking subsystem has a maximum number of HTTP connections that can be open at any one time.

Graphics Resource Limitations

The low-level graphics and images subsystem has the following limitations:

Other Resources

The limits for many resource types are set in XML files in midp/src/configuration/configuration_xml. Inside a directory corresponding to your target platform, you'll find XML files that contain limits for networking, memory, images, and other resources.

To change resource limits, edit the appropriate file and change the value. Then build the Java Wireless Client software again. For full details on how these values are incorporated into the build, see Chapter 5.