Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> OCI Memory Error
I have run into trouble when trying the following (under Oracle 8.1.6.0.0 running on Windows 2000):
1 - Attach to an Oracle database 2 - Detach from Oracle 3 - Attempt a subsequent attach
The second attach gets the error message: "HEAP[Mia.exe]: HEAP: Free Heap block 205b730 modified at 205cb24 after it was freed"
when I am attempting a allocate a second OCI_HTYPE_STMT handle.
The steps I take are:
Attach
OCIInitialize( (ub4) OCI_DEFAULT,
(dvoid *)0,
(dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 ) OCIEnvInit( (OCIEnv **) &engine->envhp, (ub4) OCI_DEFAULT, (size_t) 0, (dvoid **) 0 ) OCIHandleAlloc( (dvoid *) engine->envhp , (dvoid **) &engine->errhp ,
(ub4) OCI_HTYPE_ERROR ,
(size_t) 0 ,
(dvoid **) 0 )
Then for each cursor:
OCIHandleAlloc( (dvoid *) engine->envhp ,
(dvoid **) &engine->stmthp[i] ,
(ub4) OCI_HTYPE_STMT ,
(size_t) 0 ,
(dvoid **) 0 )
OCIHandleAlloc( (dvoid *) engine->envhp , (dvoid **) &engine->srvhp ,
(ub4) OCI_HTYPE_SERVER ,
(size_t) 0 ,
(dvoid **) 0 )
OCIHandleAlloc( (dvoid *) engine->envhp , (dvoid **) &engine->svchp ,
(ub4) OCI_HTYPE_SVCCTX ,
(size_t) 0 ,
(dvoid **) 0 )
OCILogon(engine->envhp, engine->errhp, &engine->svchp, username, strlen(username), password, strlen(password), dbname, strlen(dbname))
Detach
For each cursor:
OCIHandleFree(engine->stmthp[i], OCI_HTYPE_STMT);
OCILogoff(engine->svchp, engine->errhp);
OCIHandleFree(engine->envhp, OCI_HTYPE_ENV);
Has anyone seen a similar problem. Thanks in advance for any help you can provide.
regards,
Stephen
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Nov 27 2000 - 15:33:51 CST
![]() |
![]() |