Opening large pcap files

2 replies [Last post]
Ph.Eitt
Offline
Joined: 06/21/2010

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.

AttachmentSize
error-log.txt14.88 KB
crashdump-printout.txt1.26 KB
Mark Bednarczyk
Mark Bednarczyk's picture
Offline
Joined: 03/22/2008
You may be running out of

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.

Sly Technologies, Inc.
R&D

Ph.Eitt
Offline
Joined: 06/21/2010
Thanks for your response,

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.