I have a memory leak

Very often I get out of memory error. Even sometimes Linux becomes hanging and I’m sure it 'cause there is no enough memory. As I’ve tryed to understand why is it I can suppose to reasons. One of them is that some application seizes too much memory and I can suspect JRE. I’ve not understand what is JRE but OpenOffice always asks for JRE that isn’t installed and the message contains only OK button. I’ve not solved what to do with it and I can suppose that it can seize too much memory, but I’ve not succeeded to check it. The second reason can be incorrect swap configuration. The only thing I’ve undestand looking over the Web is that I need to look for the output


swapon -s
Filename                                Type            Size    Used    Priority

That’s what I get running this command. What does it really means - I’m not sure (especially 'cause there is a lot of information over the Web about swap files but I use a swap partition). I’m not sure does the command above shows some information only about swap files or also about swap partitions.

Tell me please how can I check which application seizes what quantity of memory and how it’s better to configure swap properly if it isn’t configured so.

typing
top

in a console may help see what you are looking for.

How much memory do you have and how much swap?

JRE = Java Runtime Environment

Surprisingly to me,
I recently discovered that plenty of situations reported to be suspected application memory leaks are actually TCP buffer issues which are harder to detect because system monitoring apps don’t usually report packet losses (at least that I’ve found so far). This can happen regardless whether you have a current active network connection, I’ve found that simply having apps open which once connected or tried to connect can cause buffer issues over a period of time.

For a preliminary summary and description, see my post today in this thread
Slow uploadrate

Also, I recommend closing all network related apps, then wait a few minutes if you’re already experiencing severe lockups.

As I note in that posting, I hope to launch an up to date web page soon which should be more complete than anything that now exists on the Web.

HTH,
Tony

The command has shown something like I’ve suspected. soffice.bin took more than 5% of memory but now I have not yet memory leak. Also XOrg took 5%. I’m not sure if it’s normal.

I’ve 1 Gb physical memory and a 3 Gb swap partition. But I’m not really sure that the swap partition is joined. May be I need to reconfigure it after I’ve ugraded Linux from 10 to 11.3, but I’m not sure how to configure swap partition properly, and suggests over the Web sometimes contradict one another.

P. S. Talking about JRE I have Java installed and I don’t understand what OpenOffice asks for. Especially when zypper ve says that everthing is OK.

On 01/31/2011 08:36 PM, Ilya81 wrote:

> The command has shown something like I’ve suspected. soffice.bin took
> more than 5% of memory but now I have not yet memory leak. Also XOrg
> took 5%. I’m not sure if it’s normal.

seems they take what they need, which is normal…

> I’ve 1 Gb physical memory and a 3 Gb swap partition. But I’m not really
> sure that the swap partition is joined.

either you have swap or you don’t, run this in a terminal to see if
you have a swap partition (might be the first listed), if you do, you
do…three GB is more than enough…


cat /etc/fstab

> May be I need to reconfigure it
> after I’ve ugraded Linux from 10 to 11.3, but I’m not sure how to
> configure swap partition properly, and suggests over the Web sometimes
> contradict one another.

no configuration of /swap is needed…if it is there and 3GB it is good…

> P. S. Talking about JRE I have Java installed and I don’t understand
> what OpenOffice asks for.

show us the error message!!


DenverD
CAVEAT: http://is.gd/bpoMD
[NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
173.14.28 3D, Athlon 64 3000+]
“It is far easier to read, understand and follow the instructions than
to undo the problems caused by not.” DD 23 Jan 11

On 01/31/2011 10:36 AM, Ilya81 wrote:
>
> gogalthorp;2284156 Wrote:
>> typing
>> top
>>
>> in a console may help see what you are looking for.
>>
>> How much memory do you have and how much swap?
>
> The command has shown something like I’ve suspected. soffice.bin took
> more than 5% of memory but now I have not yet memory leak. Also XOrg
> took 5%. I’m not sure if it’s normal.
>
> I’ve 1 Gb physical memory and a 3 Gb swap partition. But I’m not really
> sure that the swap partition is joined. May be I need to reconfigure it
> after I’ve ugraded Linux from 10 to 11.3, but I’m not sure how to
> configure swap partition properly, and suggests over the Web sometimes
> contradict one another.

To see which file systems are active, at the command line type:
mount
That will show you which partitions are currently mounted (including
your swap partition).

The cleanest way to see how much swap is being used, is to type
free
at the command line.

It’s very possible that no swap will be in use unless you have a large
number of programs open at once.

3 GB is probably overkill for your swap partition, but better to have
more than you need than not enough. I generally set my swap space to
512 MB to 1 GB. And most of it goes unused. No real point in trying to
change it though.

…Kevin

Kevin Miller
Juneau, Alaska
http://www.alaska.net/~atftb
In a recent poll, seven out of ten hard drives preferred Linux.

The outputs were the following ones


mymain:~ # cat /etc/fstab
/dev/sdb4            /                    ext3       acl,user_xattr        1 1
/dev/sdb6            swap                 swap       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/fd0             /media/floppy        auto       noauto,user,sync      0 0
/dev/sda5            /media/data          vfat       defaults,iocharset=utf8,codepage=866 0 0  
/dev/sdb1            /media/FLASH         auto       noauto                0 0
/dev/sda7            /media/data2         vfat       defaults,iocharset=utf8,codepage=866 0 0  
/dev/sda1            /media/windows       ntfs       defaults,iocharset=utf8,codepage=866 0 0
/dev/sdb11           /media/ubuntu        ext3       acl,user_xattr        0 0
/dev/sdb12           /media/linux4        reiserfs   acl,user_xattr        0 0
/dev/sda3            /media/asp           ext3       acl,user_xattr        0 0

mount
/dev/sdb4 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda5 on /media/data type vfat (rw,iocharset=utf8,codepage=866)
/dev/sda7 on /media/data2 type vfat (rw,iocharset=utf8,codepage=866)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdb11 on /media/ubuntu type ext3 (rw,acl,user_xattr)
/dev/sda1 on /media/windows type fuseblk (rw,allow_other,blksize=4096)
/dev/sdb12 on /media/linux4 type reiserfs (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/named/proc type none (ro,nosuid,nodev,bind)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
/dev/sdb9 on /media/TEMP type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)
/dev/sdb7 on /media/SOFT type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)
/dev/sdb8 on /media/DATA3 type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)
/dev/sdb5 on /media/MUSIC type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)
/dev/sdb14 on /media/MUSIC3 type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)                                      
/dev/sdb13 on /media/MUSIC2 type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)                                      
/dev/sdb10 on /media/MOVIES2 type vfat (rw,nosuid,nodev,uid=0,utf8,shortname=mixed,flush)                                     
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev) 
free                                                                                                               
             total       used       free     shared    buffers     cached                                                     
Mem:       1021012     995860      25152          0      40792     259988                                                     
-/+ buffers/cache:     695080     325932                                                                                      
Swap:            0          0          0

May be the swap doesn’t mounts automatically. fdisk shows

fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69205244

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        3916    31455238+   7  HPFS/NTFS
/dev/sda2            3917       31081   218202862+   f  W95 Ext'd (LBA)
/dev/sda3           31082       34997    31455270   83  Linux
/dev/sda4   *       34998       38913    31455270   83  Linux
/dev/sda5            3917       19571   125748756    b  W95 FAT32
/dev/sda6           19572       19963     3148708+  82  Linux swap / Solaris
/dev/sda7           19964       31081    89305303+   b  W95 FAT32

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfaf6ef7b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               2      121601   976752000    f  W95 Ext'd (LBA)
/dev/sdb5               2       15667   125837113+   b  W95 FAT32
/dev/sdb6           15668       31333   125837113+   b  W95 FAT32
/dev/sdb7           31334       46999   125837113+   c  W95 FAT32 (LBA)
/dev/sdb8           47000       62665   125837113+   c  W95 FAT32 (LBA)
/dev/sdb9           62666       69193    52436128+   b  W95 FAT32
/dev/sdb10          69194       84859   125837113+   c  W95 FAT32 (LBA)
/dev/sdb11  *       84860       87572    21792141   83  Linux
/dev/sdb12          87573       90285    21792141   83  Linux
/dev/sdb13          90286      105950   125829081    c  W95 FAT32 (LBA)
/dev/sdb14         105951      121601   125716626    c  W95 FAT32 (LBA)

May be the reason is I have /dev/sdb6 instead of /dev/sda6, but if it’s so I can’t understand how Linux loads properly if I have /dev/sdb4 instead of /dev/sda4 for the point / …

By the way here is one of the most common messages of VirtualBox for a virtual machine that uses only 192 Mb of memory.
http://s43.radikal.ru/i100/1102/ed/37181e3fc695.jpg

Swap is shown to be from sdb6 but that is a FAT. Need to change the line in /etc/fstab to a /dev/sda6

Also / seems to be wrong also. pointing to sdb not sda. I’m really not sure how this is working at all.

On 02/02/2011 06:36 AM, Ilya81 wrote:
>
> Code:
> --------------------
> mount

Snip
I ran mount just now and interestingly the swap partition does show.
But I know it is used every now and then so I guess that’s normal.

> Code:
> --------------------
> free
> total used free shared buffers cached
> Mem: 1021012 995860 25152 0 40792 259988
> -/+ buffers/cache: 695080 325932
> Swap: 0 0 0
>
> --------------------
>
> May be the swap doesn’t mounts automatically. fdisk shows

It will mount automatically if pointed at the right partition.

> May be the reason is I have /dev/sdb6 instead of /dev/sda6, but if it’s
> so I can’t understand how Linux loads properly if I have /dev/sdb4
> instead of /dev/sda4 for the point / …

As gogalthorp notes, there seems to be some mixup between fstab and
fdisk. Fix those and things should work better.

…Kevin

Kevin Miller - http://www.alaska.net/~atftb
Juneau, Alaska
In a recent survey, 7 out of 10 hard drives preferred Linux
Registered Linux User No: 307357, http://counter.li.org

If you think your swap partition is off for some reason, you can issue;

swapon -a

This command will activate swap partititions there are not currently active. (They also need to be defined in fstab.) You can also check this:

swapon - Linux Command - Unix Command