Android出现CursorWindow: Window is full: requested allocation 1354087 bytes, free space 141032 bytes,
来源:互联网 发布:微软sql server官网 编辑:程序博客网 时间:2024/05/16 05:00
在使用SQLiteDatabase插入一个比较大的数据时,抛出如下异常:
W/CursorWindow: Window is full: requested allocation 1354087 bytes, free space 141032 bytes, window size 2097152 bytes
如下图所示:
这是因为:
Android SQLite在光标返回行的窗口是指定了一个最大大小为2MB的config_cursorWindowSize值,如果你的行大小超过此限制,你会得到这个错误。无论如何,在SQLite数据库存储大量的数据是不是一个好主意,应在数据库中放置文件系统和存储文件的路径。
【Android SQLite returns rows in cursor windows that have the maximum size of 2MB as specified by config_cursorWindowSize. If your row exceeds this limit, you’ll get this error.
Storing large data in sqlite database is not a good idea anyway. Store files in filesystem and paths in database.】
在Android源码中config_cursorWindowSize值定义如下:
sdk\platforms\android-23\data\res\values\configs.xml:
<!-- When a database query is executed, the results retuned are paginated in pages of size (in KB) indicated by this value --> <integer name="config_cursorWindowSize">2048</integer>
1 0
- Android出现CursorWindow: Window is full: requested allocation 1354087 bytes, free space 141032 bytes,
- W/CursorWindow(25503): Window is full: requested allocation 5583269 bytes, free space 2096639 bytes
- Window is full: requested allocation 228 bytes, free space 124 bytes, window size 2097152 bytes
- New Memory allocation 1046759 bytes is smaller than the minimum allocation size of 1048576 bytes.
- Invalid allocation size: 4294967295 bytes
- Invalid allocation size: 4294967295 bytes
- bytes
- java.lang.OutOfMemoryError: Failed to allocate a 22440958 byte allocation with 16777216 free bytes
- Failed to allocate a 76 byte allocation with 0 free bytes and 0B until OOM
- java.lang.OutOfMemoryError: Failed to allocate a 3110419 byte allocation with 741152 free bytes and
- Failed to allocate a 38189038 byte allocation with 16777216 free bytes and 20MB until OOM
- Java # java.lang.OutOfMemoryError: requested 32744 bytes for ChunkPool::allocate. Out of swap space?
- 运行MIT-GNU Scheme出现“Requested allocation is too large”
- 运行MIT-GNU Scheme出现“Requested allocation is too large”
- Error: Read from storage 0 bytes, but requested 12 bytes 的解决方法
- 关于Django出现Specified key was too long; max key length is 767 bytes的解决办法
- xtrabackup 恢复出现错误InnoDB: Error: log file ./ib_logfile2 is of different size 0 0 bytes
- DicomIoException: Requested 132 bytes past end of fixed length stream.
- 2015年十佳数据可视化项目
- 秒杀多线程第九篇 经典线程同步总结 关键段 事件 互斥量 信号量
- CSS3的过渡效果(transition)与动画(animation)
- 消息中间件
- c# - Lazy<T> 延迟初始化对象
- Android出现CursorWindow: Window is full: requested allocation 1354087 bytes, free space 141032 bytes,
- Java编码的那些事儿
- Swift中的问号?和感叹号!
- 内存中读取bmp图片转换为IplImage格式
- 那些年遇到的那些css bug
- wifi功能 Android
- CocoaPods解决办法
- 查看Activity栈信息
- Xcode插件: MMNavigatorFont