Probably not an issue you run into much with high speed trading, but when you are running multiple vmware/virtualbox instances and each is running a glassfish app ... PermGen taming becomes a serious concern.
You still have to watch how many objects you create. This article looks at a benchmark passing events over TCP/IP at 4 billion events per minute using the net.openhft.chronicle.wire.channel package in Chronicle Wire and why we still avoid object allocations.. One of the key optimisations is creating almost no garbage. Allocation is a very cheap operation and collection of very short-lived objects is also very cheap. Does this really make a difference? What difference does one small object per event (44 bytes) make to the performance in a throughput test where GC pauses are amortised? While allocation is as efficient as possible, it doesn’t avoid the memory pressure on the L1/L2 caches of your CPUs and when many cores are busy, they are contending for memory in the shared L3 cache. Results Benchmark on a Ryzen 5950X with Ubuntu 22.10. JVM Vendor, Version No objects Throughput, Average Latency* One object per event Throughput, Average Latency* Azul Zulu 1.8.0_322 60.6 M event/s, 528
A Unique Identifier can be very useful for tracing. Those ids are even more useful when they contain a high-resolution timestamp. Not only do they record the time of an event, but if unique can help trace events as they pass through the system. Such unique timestamps however can be expensive depending on how they are implemented. This post explores a lightweight means of producing a unique, monotonically increasing system-wide nano-second resolution timestamp available in our open-source library. Uses for Unique Identifiers Unique identifiers can be useful to associate with a piece of information so that information can be referred to later unambiguously. This could be an event, a request, an order id, or a customer id. They can naturally be used as a primary key in a database or key/value store to retrieve that information later. One of the challenges of generating these identifiers is avoiding creating duplicates while not having an increasing cost. You could record every identi
There are things you can do in Java you rarely see, generally because there is no use for it. However, there are some unusual things in Java that could be surprisingly useful. Chronicle Software uses a number of different usual patterns in it’s low-level libraries most developers wouldn’t generally come across. One of them is a class that extends Throwable but isn’t an Error or an Exception. StackTrace Extends Throwable package net.openhft.chronicle.core; /** * Throwable created purely for the purposes of reporting a stack trace. * This is not an Error or an Exception and is not expected to be thrown or caught. */ public class StackTrace extends Throwable { public StackTrace() { this ( "stack trace" ); } public StackTrace(String message) { this (message, null ); } public StackTrace(String message, Throwable cause) { super (message + " on " + Thread. currentThread ().getName(), cause); } public static StackTrace forThread(Thread t) {
Happy New Year to you too.
ReplyDeleteIt has been a pleasure to read your blog during this year. I've learnt a lot.
Please, keep on writting ;)
Hi Peter,
ReplyDeleteThanks for a great Year ful of interesting posts!
Keep up the good work!
Thanks,
Markus
keep up !!!
ReplyDeleteThanks Peter. Happy New Year to you also and all the best for a prosperous year of blogging ahead
ReplyDeleteHappy New Year! Keep up the good work!
ReplyDeleteAlso, if you need a topic... PermGen profiling :)
Probably not an issue you run into much with high speed trading, but when you are running multiple vmware/virtualbox instances and each is running a glassfish app ... PermGen taming becomes a serious concern.