光标窗口:窗口已满 [英] Cursor window: window is full

查看:34
本文介绍了光标窗口:窗口已满的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个由查询返回的数据填充的 ListView.
它有效,但在 LogCat 中我收到了消息:

I've created a ListView populated by the data returned from a query.
It works, but in the LogCat I've got the message:

Cursor Window: Window is full: requested allocation 444 bytes, free space 363 bytes, window size 2097152 bytes

它使用几分钟来加载/可视化 ListView.

and it uses a couple of minutes for loading / visualizing the ListView.

我的查询返回大约 3700 行 String/Int/Double,每行 30 列;没有图像或特定数据类型

My query returns about 3700 rows of String/Int/Double, each of which with 30 columns; no images or particular datatypes

此消息的确切含义是什么,我该如何避免?
您可以通过更改此光标窗口来提高性能吗?

What does this message exactly mean and how can I avoid it?
Can you improve performances by changing this Cursor Window?

推荐答案

根据我的经验,这意味着查询结果对于光标窗口来说太大,并且需要更多内存.大多数情况下,此请求会得到满足,但在低端设备上可能会引发异常.

From my experience this means that the query results are too large for the cursor's window and it requests more memory. Most times this request is honored, but on low end devices it could throw exceptions.

我不知道相关应用程序的具体细节,但您提到的是 ListView.ListView 不能一次显示 3700 行,无限列表可以帮助加载数据按需

I don't know the specifics of the app in question but you referred to a ListView. A ListView cannot show 3700 rows at once and a endless list could help to load the data on demand

我的建议是将查询分解为多个返回较小结果的查询,并在运行下一个查询之前关闭它们.在每次连续查询后合并结果.

My advise is to break up the query into a multiple queries that return smaller results and close them before running the next query. After each successive query combine the results.

这篇关于光标窗口:窗口已满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆