From: Pepijn V. E. <pep...@lu...> - 2002-03-19 14:06:53
|
Mark, The fixes I made haven't been incorporated into the official gl4java. I asked on this list if and how I should send these patches to sven or kurt, but I didn't get any reply on that question. I can send you the fixes if you want, but it would be better to integrate them into the official release. The fix I made is a workaround for the one tesselator limit and the memory corruption that can occur when tesselating large polygons. In my application I use two tesselators in parallel and I reuse them constantly, so I guess this should work for you too. Pepijn Van Eeckhoudt ----- Original Message ----- From: "Mark Montana" <pat...@lm...> To: "Pepijn Van Eeckhoudt" <pep...@lu...> Cc: "gluser" <gl4...@li...>; "Duffy, Roy" <roy...@lm...> Sent: Tuesday, 19 March, 2002 01:14 Subject: [gl4java-usergroup] GC Bug - fix incorporated? > Pepijn, > > Do you know if anyone has incorporated your fixes into the official GL4Java yet? We had a > consistant crash in native code or freezing of our application, and we isolated it to > tesselator calls in GL4Java. Then we swtiched to deleting our used tesselator and creating a > new one for each use (as opposed to reusing the same tesselator for more than one tesselation > and being efficient about things), our crashing went away. > > I am guessing your fixes may have prevented our crashing, and would allow us to reuse the same > tesselator for more than one tesselation. > > -Mark M > > Pepijn Van Eeckhoudt wrote: > > > The problem with the current version of the tesselator isn't a memory > > leak, but a memory corruption problem. In short, if a gc occurs during > > the tesselation of an object (ie while you're calling gluTessVertex) > > there is a possibility that the vertex data is corrupted. This is due to > > the way the passed vertex data is locked and released in the native > > library. If written a fix for this, that automatically releases any > > allocated memory at the right time, but this hasn't been included in > > gl4java yet (at least I don't think so). More detailed explanations can > > be found in the mailinglist archive. > > > > Pepijn Van Eeckhoudt > > > > Mark Montana wrote: > > > Does the GL4Java glu tesselator have a memory leak currently? I know that the Magician > > > API had a release() method for their tesselator for releasing internal memory allocated > > > by the tesselator, but I did not see such a method here. > > > > > > In fact, we forgot to call the release() method in our app, and we had a nasty leak that > > > took us a while to track down. In fact, we were in danger of losing one of our customers > > > over it. > > > > > > I am very curious about what arrays the GL4Java tesselator is allocating (vertex > > > arrays?) and if it is freeing that memory. One of our graphical objects is tesselated > > > every frame (because it changes too frequently to bother with display listing), and that > > > becomes a nasty problem for us if the tesselator has a leak. Can anyone shed some light > > > for me? > > > > > > thanks, > > > mark > > > > > > Pepijn Van Eeckhoudt wrote: > > > > > > > > >>I wrote a simple memory management module that keeps track of the > > >>alocated arrays, so they can be released at a later point. I've tested > > >>this idea with the tesselation stuff, and it works fine. > > >>I've made these changes to the C files in the CNativeCode directory, > > >>which isn't ideal (should be autogenerated). Could someone explain to me > > >>where I can put my implementations of the > > >>Java_gl4java_GLUFunc14JauJNI_gluTessVertex__* functions, so they would > > >>appear in the generated c files automatically. > > >> > > >>thanks, > > >>Pepijn Van Eeckhoudt > > >> > > > > > > > > > _______________________________________________ > > > gl4java-usergroup mailing list > > > gl4...@li... > > > https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup > > > > > > > > > _______________________________________________ > gl4java-usergroup mailing list > gl4...@li... > https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup > |