光标窗口:窗口是全窗口、光标

2023-09-06 07:50:07 作者:此号已停用

我创建填充通过从查询返回的数据一个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行字符串/ INT /双,其中每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.