简体   繁体   English

在JTable中显示具有高内存消耗的ResultSet

[英]Display a ResultSet in JTable with high memory consumption

I'm currently writing a Trace-Monitor that receives messages from a device for debugging purposes. 我目前正在编写一个Trace-Monitor,它从设备接收消息以进行调试。 It looks pretty much like WireShark. 它看起来很像WireShark。

Traces are stored in a database and a JTable displays the ResultSet. 跟踪存储在数据库中,并且JTable显示ResultSet。 The problem is: As long as the Trace-Monitor is connected to the device the memory consumption goes up with every incoming trace message. 问题是:只要将跟踪监视器连接到设备,每条传入的跟踪消息的内存消耗都会增加。 I think this is because of the JTable holding references. 我认为这是因为JTable持有引用。

How can I tell the JTable to only keep the data in memory which the user actually sees in the scrolling area? 我如何告诉JTable仅将数据保留在用户实际在滚动区域中看到的内存中?

Thanks for any help 谢谢你的帮助

Do this may be of your use 这样做可能对您有用

model.setRowCount(0); model.setRowCount(0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM