#11 JADE 7.0 File Structure Changes and Memory Usage

Technical and operational updates for all users of JADE, including Jade Source Bulletins
User avatar
Jade Support
Posts: 103
Joined: Mon Aug 17, 2009 10:27 am
Location: Jade Software Corporation, Christchurch

#11 JADE 7.0 File Structure Changes and Memory Usage

Postby Jade Support » Tue Sep 20, 2011 10:29 am

This bulletin is designed as a precursor to the full documentation included with JADE 7.0. It is not meant as replacement reading nor a white paper on memory management.

In earlier releases, the space to store a database entity (a JADE object or index block, for example) was allocated serially in a file. In this discussion, these entities are referred to as database objects. When a database object was deleted, its space was tracked and that space could be reused. The database engine made calls to the operating system to read or write individual database objects. The operating system buffered parts of database files in its own system-wide cache and it was responsible for all physical I/O to the database files.

The database engine retained copies of database objects in an object cache, to minimize calls to the operating system. The object cache employed a Least Recently Used (LRU) replacement policy to maintain a working set of objects. Only one thread at a time could access a database object in the object cache. Each database object contained a checksum field, updated when the database object was written to system cache and checked when the object was read from system cache.

New File Structure in JADE 7.0
Database files are now organized as a sequence of 8K byte disk blocks, which is the basic unit of I/O and free-space management. Database Btree index blocks fully occupy a disk block. Small objects are sub-allocated within a block and objects larger in size than 8K bytes span multiple contiguous disk blocks.

Disk Cache
A new block-level caching module, called disk cache, replaces the file caching and physical I/O functions previously performed by the operating system.
The content of a disk block is stored in a buffer; the working set of blocks buffered in memory is called the buffer pool. The buffer pool manager reads or writes blocks using direct I/O. Database objects are read and updated directly in the buffer pool, removing the need for an object caching layer and its data copying overheads.

What Does This Mean?
File data cached by the operating system is not included in any Process memory accounting. In prior JADE releases the memory consumed by operating system caching of database files wasn't attributed to the database process; It was part of the global total that can be seen as "Cached" under Physical Memory on the Task Manager Performance tab.

In JADE 7.0 the memory accounting for the database Process will have a larger in-use value than you have seen in prior releases. This is because the memory used for buffers holding the disk blocks (the file data) is now directly owned and attributed to the database process.

JADE 7.0 Migration Process
The memory usage you’ll see in Task Manager largely depends on your application. However, this change is seen mostly easily during the JADE 7.0 migration, specifically the ConvertDb phase.

The process allocates memory to the buffer pool until 256MB of memory is free. At first glance it might be disconcerting to see a single JADE process consuming many gigabytes of memory.

e.g.
2011/09/19 10:03:52.076 017e4-0830 CvtDb: [187.4] projectData processing ...
2011/09/19 10:03:52.078 017e4-0830 PDB: projectData[51] added to control file
2011/09/19 10:04:13.126 017e4-041c PDB: DiskCache: segment allocated: _poolSegments= 7, pool size now 469762048 bytes (57344 blocks)
2011/09/19 10:04:24.636 017e4-041c PDB: DiskCache: segment allocated: _poolSegments= 8, pool size now 536870912 bytes (65536 blocks)

...

2011/09/19 10:25:17.649 017e4-041c PDB: DiskCache: segment allocated: _poolSegments= 93, pool size now 6241124352 bytes (761856 blocks)
Above we see the persistent database allocating segment 93, taking the buffer pool size to 6.2GB.
TaskManager.png
Example of the jadclient process during a JADE 7.0 migration.
TaskManager.png (29.87 KiB) Viewed 5341 times
The disk caching behaviour is controlled by the following INI parameter:
[PersistentDb]
DiskCacheFreeMemoryTarget
The default value is 256MB. During the migration phase it’s recommended to leave this unchanged for maximum performance. In fact, unless you are running JADE 7.0 on a dedicated server, don't modify any of the caching parameters. Let JADE manage this.

How is the Memory Released?
If free memory continually drops below the threshold JADE will continue releasing segments until it hits the configured minimum segments. But how does JADE calculate this using the DiskCacheFreeMemoryTarget value?

JADE calculates free memory as AvailableBytes + CacheBytes where AvailableBytes is the performance counter "\\Memory\\Available Bytes" and CacheBytes is the performance counter "\\Memory\\Cache Bytes".

At the time of writing the definitions of these counters were:
  • "\\Memory\Available Bytes" = the sum of memory assigned to the standby, free, and zero page lists
  • "\\Memory\\Cache Bytes" = the sum of System Cache Resident Bytes, System Driver Resident Bytes, System Code Resident Bytes, and Pool Paged Resident Bytes
When the sum of these two falls below what is configured to be kept free JADE deallocates a diskcache segment and suspends memory calculations for two sample periods (DiskCacheMemorySampleInterval, default=5000 milliseconds) to allow settling.

When memory is released you’ll see log entries like this:
2011/09/19 11:12:23.119 017e4-041c PDB: DiskCache:: system available bytes (261353472) less than DiskCacheFreeMemoryTarget (268435456), deallocating segment 94
Jade Support
Jade Software Corporation Ltd

Email: jadesupport@jadeworld.com
Web: http://www.jadeworld.com

Jade Software – complex business problems solved beautifully.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: #11 JADE 7.0 File Structure Changes and Memory Usage

Postby ghosttie » Wed Sep 21, 2011 2:40 am

Does the app server still have an object cache?
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: #11 JADE 7.0 File Structure Changes and Memory Usage

Postby BeeJay » Wed Sep 21, 2011 9:35 am

It's only the Database cache they're making a reference to in this posting, so I would imagine the JOM caches remain for all Node types:
  • DbServer Node: Persistent cache, Transient cache, Remote transient cache
  • AppServer Node: Persistent cache, Transient cache
  • Standard Client Node: Persistent cache, Transient cache (singleUser/multiUser)
Cheers,
BeeJay.

User avatar
Jade Support
Posts: 103
Joined: Mon Aug 17, 2009 10:27 am
Location: Jade Software Corporation, Christchurch

Re: #11 JADE 7.0 File Structure Changes and Memory Usage

Postby Jade Support » Wed Sep 21, 2011 1:57 pm

Thanks BeeJay, that's correct; JADE Object Manager (JOM) caching is not the subject of this bulletin.

Please note, the bulletin has been updated to explicitly state, unless you are running JADE 7.0 on a dedicated server the DiskCacheFreeMemoryTarget parameter should not be altered. Let JADE manage this.
Jade Support
Jade Software Corporation Ltd

Email: jadesupport@jadeworld.com
Web: http://www.jadeworld.com

Jade Software – complex business problems solved beautifully.


Return to “Jade Support Bulletins”

Who is online

Users browsing this forum: No registered users and 3 guests

cron