Molecules 2.02 now on the App Store

Molecules icon

Yet another update for Molecules is now live on the App Store, this time version 2.02. The focus of this update is performance, and the new version greatly improves the speed of the new rendering engine. The 3-D models are now rendered at 3-6 times the speed that they were in the previous version, which should make previously choppy framerates on the iPad 1 much smoother. If you're interested in how this significant optimization was achieved, check out my question about it on Stack Overflow. Thanks go out to Tommy and Pivot for pointing me in the right direction on this.


Thank You for creating the Molecules app and especially for making it free. I enjoy it immensely. I am an electrician and have never studied software design but the app you designed has inpired me. I think I will start to study it. My problem is my math skills are not very strong. My family has a history of learning disabilities. My daughter has broken the long line of academic problems partially through medication to become third in her class and be inducted into the National Junior Honor Society. Your brother must be as brillant as you are. once again Thank you.
Mike Soward

YOu might be interested to add details about Molecules onto the SciMobileApps Wiki. Details are here:

Thanks for making the Molecule source available. I was wondering if you had any 'low memory' issues when you ran your app on a device. I am a novice iOS OpenGLES developer and am working on a app for publication. I noticed all of the OpenGLES based applications I was able to download (i.e source) , compile and run showed an ever increasing number of live bytes and overall byte count in the Allocation instrument of the Instruments application. Any thoughts would be appreciated. Thanks much.

Please reply via if that is more convenient.

Managing memory usage in an iOS application is a topic that is far too complex to cover in a comment or an email. I can't comment on other sample code out there, but sometimes people aren't careful about memory leaks or other memory accumulation. There's always some increase in memory usage as resources are loaded in on application startup or as needed during execution.

The primary memory-related concerns that I have in this application come with the loading of large molecular structures. The Protein Data Bank has some structures that are described by files which are tens of megabytes in size. Rather that loading only portions of their files in at a time, I bring the entire file into memory and process it from there. This leads to a memory spike at that point. I've been intending to improve this, but I haven't gotten around to it yet.

Additionally, these larger structures can take up a lot of memory when their multiple vertex buffer objects are loaded in on the initial render. This can also lead to a memory spike. Short of capping the size of structures that can be loaded on older devices, I don't know a good way of preventing this.

I tend to do a lot of testing on the code I use here, such as running the static analyzer by default on builds, testing using heap shots in the Allocations instrument for any object accumulation during repeated actions, and carefully tracking the actual memory size using Memory Monitor (Allocations hides a lot of memory usage from you). Again, how to manage memory usage in an iOS application is something beyond the scope of what I can write here.

Brad, your comment: 'testing using heap shots in the Allocations instrument for any object accumulation during repeated actions, and carefully tracking the actual memory size using Memory Monitor' are two methods I will look into and appreciate the info.

Additionally, when I step through my app (or the Sample OpenGLES app from Apple), I notice a jump in the number of live bytes and total memory usage in the Allocation instruments, when the presentRenderBuffer function is called, which can be frequent, especially in animation apps. do you think i will need to unbind and remove the render buffer after i presentRenderBuffer?

Thanks very much for all of your help.

Best, George

If you see a regular memory buildup with each rendered frame, there's something wrong that you'll need to track down. The use of heap shots in Instruments is the most effective way to do this, because you'll be able to see the specific items which are accumulating on each render.

There's the possibility that this might miss things like allocated textures or geometry on the GPU side that you don't deallocate when done, but it should even be able to point out things like that.

Its a great app, but I find sometimes I can't find things on PubChem for some reason, I looked on the computer and was able to find them without a problem. Do you have any suggestions?

Unfortunately, PubChem doesn't have 3-D structure information for some compounds in their database. Molecules containing certain elements and those above a certain size have not (yet) had their structures calculated.

I only display search results for structures you can actually download and view. If you do find a compound that has a 3-D structure file associated with it when searched on PubChem's site, but that doesn't appear in my application, let me know and I'll see if there's something else going on.

Thanks for keeping the molecules code open source. This will certainly help me with creating my own 3d cube for my app.
Basically I am trying to render a 3d cube with each side having a feature [a small application on its own ] .
for example :
1st side will have a photo gallery and when you pinch the cube it goes back , so that we can rotate it to the side we want [ say side 3 ] , which will have a chat client . This is a project i have been pursuing for some time and would really appreciate your advice on achieving this the correct way , since i have just started coding iphone apps in obj-c.
Thanks once again .

Syndicate content