Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - libcam DOC driver using a lot of memory: (4 Items)
   
libcam DOC driver using a lot of memory  
Hello,

I'm trying to track down where a disk on chip (DOC) driver is allocating a lot of our ram (10MB/64) and have hit a road 
block.  The driver uses the cam library and xpt to setup a SCSI emulation layer.  I believe the allocation is occuring 
in the cam library during a call to xpt_peripheral_driver.

During tracing with the IDE, I found out that it is a call to xpt_peripheral_driver() right after a dlopen() that causes
 the large amount of memory to be allocated.  The IDE reports the majority of this space is heap.

Where might I find the source for libcam to see what's going on?  Is this released?  I know that I won't find the 
specific version we are using as it's 6.3.2 but maybe a newer version didn't change too much.

Is there any configuration items that allow a user defined amount of cache (if that's what the ram is being used as) 
during the setup of our emulation layer?

Please share any thoughts on debugging too, I'm running out of road :)

Thank you,
Liam
RE: libcam DOC driver using a lot of memory  
Liam,

It doesn't look like the libcam code is published yet on Foundry27.  How
are you measuring the RAM usage?  io-blk.so will allocate a number of
caches, and defaults to using 15% of system RAM (which works out to
~10MB).  I would suggest starting with the "cache=" command-line option,
and see if that gives you the desired effect. Eg.  "devb-doc cam verbose
blk cache=7m"

David

> -----Original Message-----
> From: Liam Howlett [mailto:community-noreply@qnx.com] 
> Sent: July 21, 2009 11:08 AM
> To: ostech-core_os
> Subject: libcam DOC driver using a lot of memory
> 
> Hello,
> 
> I'm trying to track down where a disk on chip (DOC) driver is 
> allocating a lot of our ram (10MB/64) and have hit a road 
> block.  The driver uses the cam library and xpt to setup a 
> SCSI emulation layer.  I believe the allocation is occuring 
> in the cam library during a call to xpt_peripheral_driver.
> 
> During tracing with the IDE, I found out that it is a call to 
> xpt_peripheral_driver() right after a dlopen() that causes 
> the large amount of memory to be allocated.  The IDE reports 
> the majority of this space is heap.
> 
> Where might I find the source for libcam to see what's going 
> on?  Is this released?  I know that I won't find the specific 
> version we are using as it's 6.3.2 but maybe a newer version 
> didn't change too much.
> 
> Is there any configuration items that allow a user defined 
> amount of cache (if that's what the ram is being used as) 
> during the setup of our emulation layer?
> 
> Please share any thoughts on debugging too, I'm running out of road :)
> 
> Thank you,
> Liam
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post34203
> 
> 
Re: RE: libcam DOC driver using a lot of memory  
Hey,

I'm measuring the RAM usage with `pidin info`, it's not accurate but does show a large drop such as 10MB.

I've attached a screenshot of the debug window of the IDE of the call that seems to cause the drop.

cache= doesn't seem to work for this driver.. it's not an official QNX driver.  I tried CACHE= before the command too, 
but no change.  Is there an environment variable or something that is checked by the lower level code?  Maybe I can 
change the unofficial QNX driver to pass the cache option in.. where does it need to go?

Thanks,
Liam
Attachment: Image debug_screen.png 73.96 KB
Re: RE: libcam DOC driver using a lot of memory  
Oh wow,

Sorry.. your suggestion DOES WORK!

Thanks!

I didn't have the "blk" part on the command line.

Thank you very much!