我想使用RMS来存储大量数据。我已经检查到一定的限度了。我只是想确保RMS能够存储它吗?
我已经在RMS中存储了大约1,35,000个字符,我也可以从RMS中获取它们。使用RMS可以存储多少数据?
我想在Live Application中实现它。
发布于 2012-12-25 22:05:19
对于RMS存储容量没有这样的固定限制。这完全取决于设备上有多少可用内存。
在您的应用程序中尝试以下代码片段以查找设备上的内存状态。
Runtime rt = Runtime.getRuntime();
long totalMemory = rt.totalMemory();
long freeMemory = rt.freeMemory();
// if rs is an instance of your App's RMS
// then, try
RecordStore rs = RecordStore.openRecordStore( "App_Db_Name_Here", true );
int sizeAvailable = rs.getSizeAvailable();
// it returns the amount of additional room (in bytes) available
// for this record store to grow.比较以上三个值,并在应用程序中进行相应的处理。
但是RMS IO操作将随着大小的增长而变慢,因此这种本地数据库不用于存储大型数据。同样,这在不同的设备上有所不同。在跨设备上移植你的应用程序时,你应该做出实现的决定。
有关完整的说明,请参阅:和文档。
https://stackoverflow.com/questions/14030863
复制相似问题