4 ms·
Several commenters have brought up garbage collection. I'm curious. How much heap memory do HFT applications typically allocate in a day? I'd expect them to b
by tzs 6y ago
Several commenters have brought up garbage collection.
I'm curious. How much heap memory do HFT applications typically allocate in a day?
I'd expect them to be doing most of the work, or at least most of what actually needs low latency, in locally allocated primitives which would be on the stack. If that's the case, you might be able to turn off garbage collection and just stick enough RAM in your computer that it takes a day to fill up with garbage. Once a day, reboot.
- MaxBarraclough 6y ago> you might be able to turn off garbage collection and just stick enough RAM in your computer that it takes a day to fill up with garbage. Once a day, reboot Assuming the code can be made not to allocate much, this approach could probably be made to work, [0] but I imagine it would make more sense to just configure the GC to run once a day. [0] https://openjdk.java.net/jeps/318 https://openjdk.java.net/jeps/318
- adrianmonk 6y ago> Once a day, reboot. Alternatively, you could have a pool of Java servers and coordinate GC with your load balancer. That is, some system would: (1) coordinate with the load balancer (or directory service of endpoints) to ensure that a Java node is completely out of the pool (2) coordinate with the Java node to ensure all its in-progress requests have completed (3) run a full GC on that node (4) return it to the pool (5) move on to the next node, cycling through them. You probably wouldn't need to increase the number of Java nodes very much, either. If a GC is required every 10 minutes and it only takes 30 seconds to do this, then you only need 5% more Java nodes.