Most top implementations have a way to turn the display of threads on or off.
- htop: in the “Setup / Display options” menu, “Hide userlands threads”.
- Linux top: press
H to toggle the showing of threads (but they're off by default).
- OpenBSD top: press
T to toggle the showing of threads (but they're off by default).
Note that memory mappings, and hence memory occupation, is a property of a process, so you'll always see the same numbers for every thread in a process. If you see different numbers, it means there are multiple processes.
There's no easy way to find out the total memory consumption of a set of processes because the concept isn't well-defined. Some of the memory may be shared; this happens all the time with shared libraries, and in addition related processes (such as multiple instances of a server) are more likely to use shared memory to exchange data. If you just add the figures, you'll often get a number that's a lot larger than the actual used memory.