Comments (10)
This code has the same problem :
PcapHandle h = Pcaps.openOffline(pcapFilename);
h.loop(0, new PacketListener() {
long nbPackets=0;
@Override
public void gotPacket(Packet p) {
UdpPacket up = p.get(UdpPacket.class);
if (up != null) {
System.out.println(nbPackets++ + " " + p.toString());
}
}
});
from pcap4j.
PcapHandle doesn't hold any packets. Anyway it seems someone (packet classes, jna, or stuff) leaks memory. I will investigate it.
from pcap4j.
I tried your code with my pcap file including 600000 UDP packets but I couldn't reproduce the OOM.
Can I try with your pcap file?
from pcap4j.
I can't, the pcap file contain some sensitive information. I finally used the Perl lib Net::Pcap to extract the data from the file without problem. If I have a non-private data to share, I will.
from pcap4j.
What version of JRE you use?
I use :
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
on Ubuntu 14.04 LTS
from pcap4j.
I tried it with
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1)
OpenJDK Server VM (build 23.7-b01, mixed mode)
on Ubuntu 13.04 but no error occured.
Can I see the OOM error message you saw?
from pcap4j.
Hi Kaitoy,
It looks like the problem occurs only when I run within Eclipse (It crashes my workspace most of the time when the number of packets are high).
I use Eclipse 4.4 (Luna) with a lot of plugins installed.
Can you try to run in Eclipse with a significant amount of packets?
When I inspect with jvisualvm I see a lot of LazyValue and char[] that does not seem to be freed over time.
However, I did the same test on the command line (without Eclipse) and there was no memory problem.
I'm not sure what is the exact root cause of the OOM, but I think that you can close the issue.
Thanks for your time.
from pcap4j.
I ran it on Eclipse Kepler but no error. And when I monitored memory usage and objects with jvisualvm while reading a huge pcap file, it looked all objects including LazyValue and char[] are properly GCed.
So, let me close this ticket without changes.
from pcap4j.
happend to me as well on MAC.
try packet = h.getNextPacketEx(); see if it helps.
from pcap4j.
why was this closed? I still get this with pcap4j , lots of LazyValue objects not being freed. happens with both loop function and iterate with readPacketEx. If you want example files, see this for example. From https://iextrading.com/trading/market-data/#tops
from pcap4j.
Related Issues (20)
- Interrupt pool Thread
- [Linux os][Windows "System32" Path.get] crash on init HOT 2
- Install native libs (Npcap/libpcap) programmatically automatically HOT 1
- win10pcap can't get the linklayerAddress,it's not compatible
- How can I get mac address? HOT 2
- support 802.1x?
- Unknow tcp option doesnt support reserved options
- Moving forward with 2.0.0?
- About the getNextPacketEx problem under linux
- with pcap4j find the process name which makes the network traffic in windows with java
- Having trouble retrieving package data HOT 2
- macos issues
- How to get source and destination Ip from TCP packet HOT 1
- Library does not initialise on Linux HOT 2
- Runing on the a linux service reports a null pointer exception
- 通过抓包或者分析数据包,如何将HTTP的请求和响应关联起来呢?
- Getting timestamp and src/dest IP addresses for UDP packet? HOT 5
- Ignore this...
- Decoding mDNS packets?
- The problem of capturing WiFi wireless network packets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcap4j.