Hi,
There are other ways, but it's hard to say if they are better or not. If
performance is the most important problem, then it sounds like a good
solution.
For example, you could use the in-memory file system and a large cache
size: jdbc:h2:memFS:test - or you could use the compressing in-memory file
system: jdbc:h2:memLZF:test. This will slow down processing, but save
memory. But in both cases you may still need to delete data from time to
time.
Regards,
Thomas
On Wednesday, April 18, 2012, Peter Childs wrote:
> 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.
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
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.