This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Run FileModelTest. Test does not fail, but I see OutOfMemoryError in console: INFO: Direct buffer memory java.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Bits.java:658) at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:123) at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306) at org.netbeans.modules.cnd.repository.storage.data.RepositoryDataOutputStream$OutputStreamEx.write(RepositoryDataOutputStream.java:161) at java.io.DataOutputStream.write(DataOutputStream.java:107) at org.netbeans.modules.cnd.repository.storage.data.UTF.writeUTF(UTF.java:133) at org.netbeans.modules.cnd.repository.storage.data.RepositoryDataOutputStream.writeCharSequenceUTF(RepositoryDataOutputStream.java:78) at org.netbeans.modules.cnd.modelimpl.repository.PersistentUtils.writeUTF(PersistentUtils.java:338) at org.netbeans.modules.cnd.modelimpl.repository.OffsetableKey.write(OffsetableKey.java:135) at org.netbeans.modules.cnd.repository.support.AbstractObjectFactory.writeSelfPersistent(AbstractObjectFactory.java:69) at org.netbeans.modules.cnd.modelimpl.repository.KeyObjectFactory.writeKey(KeyObjectFactory.java:73) at org.netbeans.modules.cnd.modelimpl.uid.KeyBasedUID.write(KeyBasedUID.java:111) at org.netbeans.modules.cnd.repository.support.AbstractObjectFactory.writeSelfPersistent(AbstractObjectFactory.java:69) at org.netbeans.modules.cnd.modelimpl.uid.UIDObjectFactory.writeUID(UIDObjectFactory.java:131) at org.netbeans.modules.cnd.modelimpl.csm.VariableImpl.write(VariableImpl.java:506) at org.netbeans.modules.cnd.modelimpl.csm.ParameterImpl.write(ParameterImpl.java:110) at org.netbeans.modules.cnd.modelimpl.repository.PersistentUtils.writeParameter(PersistentUtils.java:239) at org.netbeans.modules.cnd.modelimpl.repository.PersistentUtils.writeParameters(PersistentUtils.java:192) at org.netbeans.modules.cnd.modelimpl.csm.ParameterListImpl.write(ParameterListImpl.java:140) at org.netbeans.modules.cnd.modelimpl.csm.FunctionParameterListImpl.write(FunctionParameterListImpl.java:174) at org.netbeans.modules.cnd.modelimpl.repository.PersistentUtils.writeParameterList(PersistentUtils.java:154) at org.netbeans.modules.cnd.modelimpl.csm.FunctionImpl.write(FunctionImpl.java:1027) at org.netbeans.modules.cnd.modelimpl.csm.FunctionDDImpl.write(FunctionDDImpl.java:325) at org.netbeans.modules.cnd.repository.support.AbstractObjectFactory.writeSelfPersistent(AbstractObjectFactory.java:69) at org.netbeans.modules.cnd.modelimpl.csm.core.CsmObjectFactory.write(CsmObjectFactory.java:610) at org.netbeans.modules.cnd.repository.AsyncRepositoryWriterImpl$Worker.doWrite(AsyncRepositoryWriterImpl.java:327) at org.netbeans.modules.cnd.repository.AsyncRepositoryWriterImpl$Worker.run(AsyncRepositoryWriterImpl.java:295) at org.openide.util.RequestProcessor$FixedRateTask.run(RequestProcessor.java:1187) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
It fails on file cnd.modelimpl/test/unit/data/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/10000parameters.c The file contains function that has 10000 parameters. When writing a parameter, we also write its scope key. The scope key writes function signature in the case it's from macro. The signature length is ~40K, and we write it 10000 times when writing parameter.
Created attachment 146867 [details] possible fix
Created attachment 146883 [details] The same fix with minor improvements and all tests passed (just in case, to have a safe and easy fix)
Integrated into 'main-silver', will be available in build *201404230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/d5699a617b4f User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixed #243960 - OutOfMemoryError in code model tests
reviewed with Alexander Simon; pushed to release80 on enum as change set 17e7a29d1bb0; awaiting for tests in release80 contest to pass
fixed in releases (release80 branch): http://hg.netbeans.org/releases/rev/8087d7ab5b34
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/8087d7ab5b34 User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixed #243960 - OutOfMemoryError in code model tests (transplanted from d5699a617b4fa7e3247ecc7814d11b61a629ca1c)