how to check available memory in Linux kernel and task interruptible problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Hi,
   I try to see if there is any function or commands that can check the
total memory used and available in the linux kernel at any pt of time. There
is this program of mine that always hang at different pt in the code. I
suspect there is a memory leak somewhere.  In the program, i used 
printk("<1> before task interruptible\n");
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ);
printk("<1> after task interruptible\n");

i printed out HZ and comes out of a value of 64 in my PC. however, as i
continously ran the code many times in a for loop,a printk statement just
before the current->state = TASK_INTERRUPTIBLE suggest that the code
executed the command but the code did not get out of the state even after
the schedule_timeout(HZ) as i check the log messages in /var/log/messages
that the printk statement after schedule_timeout(HZ) did not appear. What
could have cause this problem that the state did not return?
i tried to use udelay or mdelay instead but the code that i running would
still hang at some pt in the time after many for loop. i need to wait as i
sent a command to my PCI card and need to wait a bit b4 i can grab the
response from my PCI card.
is there any other alternatives to this problem?

Thanks a lot 
Regards
Ryan
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux