in reply to collective unconcious (about shared memory...)

If you're using shared memory, what does the ipcs look like? maybe I'm crazy, and that's very possible, but Using IPC::Shareable as long as you use the same "glue" your data will share the memory space alotted.. This may or may not be helpful to you as I'm not sure what you're doing with the shared memory. Also, with IPC::Shareable if you are attempting to lock the shared memory from the other processes, you'll have some problems as children inherit locks from their parents and that gets kinda messy. Check the results of an 'ipcs' on the system.. and clean up old semaphores and shared memory handles.

General memory saving tips that I use, (feel free to beat me if this sounds stupid).
1) Scope - never allow variables to exist where they dont' need to.
2) If there's a potential to return 5 bazillion records or lines on a db query/file open, process the records line by line.. don't read them all into an array and THEN work on them one at a time.
3) Pass references to sub routines, not copies. (this could be dangerous so WATCH WHAT YOU ARE DOING!)
4) Buy more RAM, its like dirt cheap! ;)

That's all I could think of off the top of my head.. if you provide a little more insight into what you're doing, maybe an example piece of code, we might be able to help more..


-brad..
  • Comment on Re: collective unconcious (about shared memory...)

Replies are listed 'Best First'.
Re: Re: collective unconcious (about shared memory...)
by dshahin (Pilgrim) on Apr 17, 2001 at 05:30 UTC
    I'm not really interested in utilizing shared memory, so much as I need to justify/clarify the amount of memory used by my processes.
    but if it can help me utilize less system resources overall, I might be interested.

    thanks :)