Hi Mark,
when I'm trying to open, let's say, 2 large pcap files (600-700 MB) and store the packets in a list, I'm getting an OutOfMemoryException, despite the fact that I started the program with a maximum heap size of 2 GB. The exception is thrown from the native/c code.
Perhaps you have any suggestions, how to avoid that.
Best wishes
Philipp
P.S.:
Attached you'll find the crash dump and the printout of a small test program to check the actual available memory.
| Attachment | Size |
|---|---|
| error-log.txt | 14.88 KB |
| crashdump-printout.txt | 1.26 KB |
You may be running out of memory physically. jNetPcap allocates between 100-200bytes per packet, plus other memory. The -Xmx parameter should do the trick, if you have enough memory to handle all the packets at once.
You can monitor native memory usage with the "static" JMemory.allocated and other like it calls.
Also you can call JMemory.toDebugString to get individual packet memory usage information.
Sorry for the late response. I'm on vacation for another week. I'll be back in the states next the week of the 9th.
my fault was that i gave the virtual machine too much memory, so that the native part hadn't enough memory to load all the packets.
Have nice holidays
Philipp