On May 30, 2013, at 9:32 AM, Cody Permann <[email protected]> wrote:
>> >> Hi, >> >> Is there a way to get the memory footprint of individual datastructures >> in the library? For example, if I want to know the size of a DofMap, and a >> Mesh? >> >> Thanks, >> Manav >> > > I'd certainly really like to hear thoughts on this too. We've been working > on a python script that measures "Resident Memory" sizes of each process at > a fairly high sample rate. The initial results we've gotten from this tool > are very interesting and appear fairly accurate. We are currently working > to make that script work across a distributed machine by sending messages > across an independent socket on each node which we open and maintain in our > main python process. While this isn't terribly difficult to do, it lacks > the resolution down to the data structure level that you are inquiring > about so I'd be interested to hear other thoughts as well. at present, there is no e.g. mesh.memory_usage() function. I can definitely see the value of this, but also fear at the code proliferation required to implement it, and also worry it could get stale in a hurry. This would be most useful for optimized runs where you want to stay below a memory threshold. I'd think? > I spent the better part of a day last wekk messing around with trying to > build my own C++ allocator that kept track of each allocation/deallocation > call that was made which allowed me to total up the bytes used in that > particular data structure, but I didn't get it working for sets and maps > which would be essential to track memory usage of many of the more > interesting data structures in libMesh. For now, I've shelved that project > again since we have many more important things to do but I would like to > get it working at some point. This is basically what I do, but I use valgrind's massif tool: http://valgrind.org/docs/manual/ms-manual.html This wraps malloc and reports exactly what memory is used by what data structures. There is a significant runtime penalty for it, but it is as precise as you could hope to get. Apple's Xcode's 'Instruments' has another tool which does a similar job but a lot faster. Basically, compile your app with CXXFLAGS="-g" to make sure debugging symbols are in optimized mode, and run it through Instruments using the memory profiling tool. -Ben ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
