cannot create Cursor because the system is out of memory. The following is the block of code
that is in question
public void insertCBJL(ArrayList<CBJLBean> cbjlList) {
if (cbjlList.size() > 0) {
mysql.beginTransaction();
for (CBJLBean bean : cbjlList) {
Cursor cursor = mysql.rawQuery(
"select * from cbjl_table where yhh=?",
new String[] { bean.getYhh()});
if (cursor.getCount() > 0) {
continue;
}
mysql.execSQL("insert into cbjl_table(cbcid,...,scsyql) values (?,...,?)",
new Object[] { bean.getCbcid(),...,bean.getScsyql() });
}
mysql.setTransactionSuccessful();
mysql.endTransaction();
}
}
After the
for loop, there is a query statement that was originally inserted into the database in order for the data to be repeated. However, there is a big mistake. After being used, it is not closed, which causes the memory overflow.
Read More:
- Failed to extend swap file from 0 kb to xxx kb.
- FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
- windows GitLab: PTY allocation request failed on channel 0
- Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory
- When local git connects to github: PTY allocation request failed on channel 0
- TypeError: object of type ‘Cursor‘ has no len()
- Android EditText cursor control, color modification, show and hide
- Hbase Native memory allocation (mmap) failed to map xxx bytes for committing reserved memory
- Linux command line cursor moving skills
- Fatal error: Newspace:: rebalance allocation failed – process out of memory (memory overflow)
- The problem of cursor skipping in wangeditor
- Request window feature for Android Development( Window.FEATURE_ NO_ Title) does not take effect
- Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution
- How to remove the title bar (using the request window feature)( Window.FEATURE_ NO_ Title); why it fails)
- How to Solve Win 10 Kb5008212 can’t share printer Issue
- Android studio displays the class and method where the cursor is located
- Error occurred during initialization of VM Could not reserve enough space for 3145728KB object heap
- Installation window services prompt error [SC] OpenSCManager FAILED 5
- [Android] using request window feature( Window.FEATURE_ NO_ Title) method to remove the title invalid solution
- Ubutnu’s idea input method candidate box can’t follow the cursor