Gday folks.

I have been using H2 in an application where I store packet off the wire in 
a database with no disk persistence (it is not required)

I have found that I can store about 17million rows (packets) in a table in 
about say 31gb of RAM without issues, and the stability is great.

I feel that currently I am managing my database size/memory in a 'wrong' 
way.

I have a monitoring thread that every 5 seconds checks memory usage, and if 
greater than 93% I delete 1% of the oldest rows in the table.

ie.
  MemoryUsage mu = mbean.getHeapMemoryUsage();
  double pU = (double) mu.getUsed() / (double) mu.getMax() * 100; 
  if (pU > 93) {  // do things };

This has been typically successful in stopping the app exploding with a 
OutOfMemory exception.

Is there a better way of managing this (ie ways to understand how much 
memory a table is using etc?)

Cheers,
   Peter

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/h2-database/-/dt7OhI8UFNIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to