2011-03-09 09:29:57     Memory problem - QT - initramfs - xip

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-03-09 09:29:57     Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 98772   

 

Hello,

we are working on a custom board with BF-548, 64MB RAM, SPI Flash 16MB (no NAND Flash). uClinux distribution 2009R1. For our application we need QT/E as well.

 

Our problem is the memory footprint of the system.

 

The uClinux Image is saved in SPI Flash. While booting it is loaded into memory and starts there. QT libraries are shared and are included in the image. So after start the uClinux with all libraries takes something like 28 MB in the memory. When we start our QT GUI application (0,5MB) it takes another 24MB. Everything is working so far, but there is not much memory left and our application will grow.

We assume that the Qt libraries are loaded into cache and that is why the QT application takes so much memory. So the QT libraries are twice in the system memory(in filesystem and cache) is this assumption right?

 

Is it possible to avoid this? Is xip (execute in place) supposed to work in initramfs as well? So the libraries wont be loaded into cache? If so, Could you provide a little hint how to manage this?

We enabled the option: support Xip filesystems on RAM devices but no change. We tried uClinux dist2010 as well (as we read that xip is not supported on earlier dist).

 

Or do you have any other idea how to solve our memory problem? We dont have any parallel flash or SD card to store the QT libraries in. We already disabled features from QT we dont need to make the libraries smaller. 

 

 

Thanks for your help.

juraj

QuoteReplyEditDelete

 

 

2011-03-09 14:48:35     Re: Memory problem - QT - initramfs - xip

Mike Frysinger (UNITED STATES)

Message: 98786   

 

xip files in initramfs should "just work".  but that applies only to executable sections and read-only data.  writable data must be duplicated for every instance.

 

are you using initramfs for your rootfs ?  or is your rootfs in spi flash ?  please post the full boot output from the kernel.

QuoteReplyEditDelete

 

 

2011-03-09 22:41:06     Re: Memory problem - QT - initramfs - xip

Sonic Zhang (CHINA)

Message: 98809   

 

Don't use initramfs in your final product. With initramfs, all root file system is located in DRAM and occupy a lot free memory. Then, only one copy of QT library is loaded into memory.

QuoteReplyEditDelete

 

 

2011-03-09 22:49:59     Re: Memory problem - QT - initramfs - xip

Sonic Zhang (CHINA)

Message: 98810   

 

Put your root filesystem in SPI flash. Then, only one copy of QT library is loaded into memory.

QuoteReplyEditDelete

 

 

2011-03-10 04:00:06     Re: Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 98841   

 

Hi Guys,thanks for your responses!

 

We are using initramfs. In our SPI flash is the u-boot image, uclinux image (uImage.gz.initramfs) and an alternative dsp firmware.

The filesystem is in the system memory after start of uclinux.

I tried to set all libraries as read only - but no change in the memory consumption. Do i have to set the whole filesystem as read only (how)?

 

Memory footprint:

After boot:

root: /> free

              total       used      free          shared        buffers

Mem:  61232   25408    35824        0                      0

 

When we start the application:

root: /> free

               total        used        free       shared      buffers

Mem:   61232    48856     12376       0                  0

 

The size of the application is only 0,5MB, so we assume it loads all the qt libraries in memory again.

 

We cannot put the filesystem in SPI Flash - not enough space.

 

Here is the boot output:

 

 

 

## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   bf548-2.6.34.7-ADI-2010R1

   Created:      2011-03-10   7:41:49 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    10467309 Bytes = 10 MB

   Load Address: 00001000

   Entry Point:  002a9d90

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 002a9d90

Linux version 2.6.34.7-ADI-2010R1 (abs@Virtualmachine) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #211 Thu Mar 10 08:41:44 CET 2011

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x001a47a0

  rodata    = 0x001a47a0-0x00246998

  bss       = 0x00247000-0x0027fd50

  data      = 0x0027fd60-0x002a6000

    stack   = 0x002a4000-0x002a6000

  init      = 0x002a6000-0x01539000

  available = 0x01539000-0x03f00000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 3

Reset caused by Software reset

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF548 Rev any, running on 0.2

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 528 MHz core clock and 132 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

  L2 SRAM        : uncacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-through) in data cache

  L2 SRAM        : uncacheable in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 16002

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=24000000 earlyprintk=serial,uart0,57600 console=tty0 console=ttyBF0,57600 ip=192.168.13.25:192.168.13.138:192.168.0.1:255.255.255.0:bf548-ezkit:eth0:off

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 42212k/65536k RAM, (19020k init code, 1677k kernel code, 1031k data, 1024k dma, 572k reserved)

Hierarchical RCU implementation.

NR_IRQS:295

Configuring Blackfin Priority Driven Interrupts

Console: colour dummy device 80x25

console [tty0] enabled

Calibrating delay loop... 1052.67 BogoMIPS (lpj=2105344)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (42 KB free)

Blackfin L2 SRAM: 128 KB (128 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

bio: create slab <bio-0> at 0

SCSI subsystem initialized

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@4

bfin-spi bfin-spi.1: cs64 >= max 4

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc02300, dma channel@5

bfin-spi bfin-spi.2: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc02400, dma channel@23

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc00700

i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc02200

Switching to clocksource bfin_cs_cycles

musb_hdrc: version 6.0, musb-dma, host, debug=0

musb_hdrc: kernel must blacklist external hubs

musb_hdrc musb_hdrc.0: MUSB HDRC host driver

musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1

usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

usb usb1: Product: MUSB HDRC host driver

usb usb1: Manufacturer: Linux 2.6.34.7-ADI-2010R1 musb-hcd

usb usb1: SerialNumber: musb_hdrc.0

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

musb_hdrc musb_hdrc.0: USB Host mode controller at ffc03c00 using DMA, IRQ 82

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

NTFS driver 2.1.29 [Flags: R/W].

msgmni has been set to 82

io scheduler noop registered (default)

io scheduler cfq registered

bfin-otp: initialized

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 21) is a BFIN-UART

console [ttyBF0] enabled

bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 48) is a BFIN-UART

brd: module loaded

m25p80 spi0.1: m25p128 (16384 Kbytes)

Creating 1 MTD partitions on "m25p128":

0x000000000000-0x000001000000 : "DSP Flash"

smsc911x: Driver version 2008-10-21.

smsc911x-mdio: probed

eth0: attached PHY driver [SMSC LAN8700] (mii_bus:phy_addr=0:01, irq=-1)

net eth0: MAC Address: a6:00:6b:c4:0e:4b

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

vnccu_ps2_mouse vnccu_ps2_mouse: VNCCU PS/2 at 0x20000708 mapped to 0x20000708, irq=249

vnccu_ps2_kbd vnccu_ps2_kbd: VNCCU PS/2 at 0x2000070C mapped to 0x2000070c, irq=249

mice: PS/2 mouse device common for all mice

input: VNCCU Front Keyboard as /devices/platform/vnccu-front-kbd.0/input/input0

atkbd serio0: keyboard reset failed on vnccups2/serio at 20000708

atkbd serio1: keyboard reset failed on vnccups2/serio at 2000070C

rtc-m41t80 0-0068: chip found, driver version 0.05

rtc-m41t80 0-0068: rtc core: registered m41t81 as rtc0

i2c /dev entries driver

vnccu_i2c_fpga vnccu_i2c_fpga.2: using pins 20000704 (SDA) and 20000704 (SCL)

vnccu_i2c_fpga vnccu_i2c_fpga.3: using pins 20000706 (SDA) and 20000706 (SCL)

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

dma_alloc_init: dma_page @ 0x034c2000 - 256 pages at 0x03f00000

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

TCP cubic registered

NET: Registered protocol family 17

rtc-m41t80 0-0068: hctosys: invalid date/time

net eth0: SMSC911x/921x identified at 0x24000000, IRQ: 109

IP-Config: Gateway not on directly connected network.

Freeing unused kernel memory: 19020k freed

 

Welcome to:

____ _ _

/ __| ||_| _ _

_ _| | | | _ ____ _ _ \ \/ /

| | | | | | || | _ \| | | | \ /

| |_| | |__| || | | | | |_| | / \

| ___\____|_||_|_| |_|\____|/_/\_\

|_|

 

For further information see:

  www.uclinux.org/

  blackfin.uclinux.org/

  www.bluetechnix.at

 

root: />

 

 

 

Are we missing something? Do you have any idea how to manage the memory consumption?

Thanks!

 

QuoteReplyEditDelete

 

 

2011-03-10 04:08:20     Re: Memory problem - QT - initramfs - xip

Mike Frysinger (UNITED STATES)

Message: 98842   

 

file perms are not what we're talking about and have no meaning to XIP.  what matters is the ELF PT_LOAD segments.  you can use `readelf -l` to view them ... only the read-only parts of the ELF can possibly be XIP-ed.

 

you can read /proc/maps to see where libraries are being loaded exactly.

QuoteReplyEditDelete

 

 

2011-03-10 06:56:05     Re: Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 98847   

 

Ok, i did readelf -l on th Qt library file and the application:

 

/lib$ readelf -l libQtGui.so

 

Elf file type is DYN (Shared object file)

Entry point 0x19042c

There are 5 program headers, starting at offset 52

 

Program Headers:

  Type                    Offset         VirtAddr     PhysAddr    FileSiz     MemSiz     Flg Align

  LOAD                0x000000      0x00000000      0x00000000      0x7c6038      0x7c6038      R E 0x1000

  LOAD                0x7c6038      0x007c7038     0x007c7038      0x15bce8      0x15d7bc      RW 0x1000

  DYNAMIC           0x8fd124       0x008fe124      0x008fe124      0x00118       0x00118      RW 0x4

  GNU_EH_FRAME 0x7c6030      0x007c6030      0x007c6030      0x00008      0x00008      R 0x4

  GNU_STACK       0x000000      0x00000000      0x00000000      0x00000      0x20000      RW 0x8

 

Section to Segment mapping:

Segment Sections...

00 .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .rofixup .eh_frame_hdr

01 .eh_frame .gcc_except_table .ctors .dtors .jcr .data.rel.ro .dynamic .data .got .bss

02 .dynamic

03 .eh_frame_hdr

04

 

- as i can see, the biggist LOAD segment is read only.

 

The application:

/lib$ readelf -l VNCCUmain

 

Elf file type is EXEC (Executable file)

Entry point 0x1f60c

There are 7 program headers, starting at offset 52

 

Program Headers:

                                   Type           Offset                     VirtAddr      PhysAddr      FileSiz      MemSiz      Flg Align

PHDR                     0x000034      0x00000034      0x00000034      0x000e0      0x000e0      R E 0x4

INTERP                   0x000114      0x00000114      0x00000114      0x00014     0x00014      R 0x1

[Requesting program interpreter: /lib/ld-uClibc.so.0]

LOAD                     0x000000      0x00000000      0x00000000      0x5d370      0x5d370      R E 0x1000

LOAD                     0x05d370      0x0005e370      0x0005e370     0x12908      0x12938      RW 0x1000

DYNAMIC               0x06aa30      0x0006ba30      0x0006ba30     0x00108      0x00108      RW 0x4

GNU_EH_FRAME  0x05c16c      0x0005c16c      0x0005c16c       0x01204      0x01204      R 0x4

GNU_STACK         0x000000      0x00000000      0x00000000      0x00000      0x20000      RWE 0x8

 

Section to Segment mapping:

Segment Sections...

00

01 .interp

02 .interp .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .rofixup .eh_frame_hdr

03 .eh_frame .gcc_except_table .ctors .dtors .jcr .data.rel.ro .dynamic .data .got .bss

04 .dynamic

05 .eh_frame_hdr

06

 

 

I checked the /proc/maps as well and here ist the output before the application starts:

 

root: /> cat proc/maps

00390000-00391000 rw-p 00000000 00:01 781 /lib/libutil.so.0

01147000-01148000 r-xs 00000000 00:01 781 /lib/libutil.so.0

01148000-01149000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

01240000-01244000 rw-p 0003a000 00:01 659 /bin/busybox

01244000-01246000 rw-p 00000000 00:00 0

01246000-01247000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

01248000-0124d000 rw-p 00000000 00:00 0

01250000-01252000 rw-p 00004000 00:01 717 /bin/telnetd

01253000-01254000 rw-p 00000000 00:00 0

01254000-01258000 rw-p 0003a000 00:01 659 /bin/busybox

01258000-0125d000 rw-p 00000000 00:00 0

01260000-01280000 rw-p 00000000 00:00 0

01280000-01285000 rw-p 00000000 00:00 0

012a0000-012c0000 rw-p 00000000 00:00 0

01480000-01485000 r-xs 00000000 00:01 717 /bin/telnetd

0148f000-01490000 rw-p 00000000 00:00 0

015d9000-015da000 rw-p 00000000 00:00 0

015da000-015dc000 rw-p 00000000 00:00 0

02055000-02056000 rw-p 00000000 00:00 0

020d8000-020d9000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

020d9000-020da000 rw-p 00000000 00:00 0

020de000-020df000 rw-p 00000000 00:00 0

020df000-020e0000 rw-p 00000000 00:00 0

034b5000-034b6000 rw-p 00002000 00:01 679 /bin/init

034b6000-034b7000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

034c6000-034c7000 rw-p 00000000 00:00 0

034c8000-034cb000 r-xs 00000000 00:01 679 /bin/init

034ce000-034d0000 rw-p 00000000 00:00 0

034d0000-034d5000 r-xs 00000000 00:01 728 /lib/ld-uClibc.so.0

034d8000-034db000 r-xs 00000000 00:01 724 /lib/libcrypt.so.0

034dc000-034e0000 rw-p 0003a000 00:01 659 /bin/busybox

034e0000-03500000 rw-p 00000000 00:00 0

03500000-03512000 rw-p 00000000 00:00 0

03520000-0352e000 r-xs 00000000 00:01 774 /lib/libgcc_s.so.1

03530000-03535000 rw-p 00000000 00:00 0

03538000-0353c000 rw-p 0003a000 00:01 659 /bin/busybox

0353e000-0353f000 rw-p 00002000 00:01 590 /bin/inetd

03540000-0357b000 r-xs 00000000 00:01 772 /lib/libc.so.0

03580000-035bb000 r-xs 00000000 00:01 659 /bin/busybox

035c0000-035e0000 rw-p 00000000 00:00 0

035e1000-035e2000 rw-p 00000000 00:00 0

035e2000-035e3000 rw-p 00002000 00:01 590 /bin/inetd

035e3000-035e4000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e4000-035e5000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e5000-035e6000 rw-p 00000000 00:00 0

035e6000-035e7000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e7000-035e8000 rw-p 00000000 00:00 0

035ea000-035eb000 rw-p 00000000 00:00 0

035f0000-035f2000 rw-p 00000000 00:00 0

035f3000-035f4000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035f6000-035f8000 rw-p 00000000 00:00 0

035f8000-035fd000 rw-p 00000000 00:00 0

03600000-03620000 rw-p 00000000 00:00 0

03622000-03623000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

036b8000-036bb000 r-xs 00000000 00:01 590 /bin/inetd

036bc000-036bd000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

036bd000-036be000 rw-p 00000000 00:00 0

036be000-036bf000 rw-p 00000000 00:00 0

036bf000-036c0000 rw-p 00000000 00:00 0

036c0000-036e0000 rw-p 00000000 00:00 0

036e0000-036e4000 rw-p 0003a000 00:01 659 /bin/busybox

036e4000-036e8000 rw-p 0003a000 00:01 659 /bin/busybox

036ea000-036eb000 rw-p 00000000 00:00 0

036eb000-036ec000 rw-p 00000000 00:00 0

036ec000-036ed000 rw-p 00000000 00:00 0

036f0000-036f5000 rw-p 00000000 00:00 0

036f9000-036fa000 rw-p 00000000 00:00 0

036fc000-036fe000 rw-p 00000000 00:00 0

036fe000-03700000 rw-p 00000000 00:00 0

03700000-03720000 rw-p 00000000 00:00 0

03720000-03740000 rw-p 00000000 00:00 0

03740000-03760000 rw-p 00000000 00:00 0

03760000-03765000 rw-p 00000000 00:00 0

03768000-0376d000 rw-p 00000000 00:00 0

03770000-03772000 rw-p 00000000 00:00 0

03772000-03773000 rw-p 00000000 00:00 0

03778000-0377d000 rw-p 00000000 00:00 0

03780000-03785000 rw-p 00000000 00:00 0

0378c000-0378e000 rw-p 00000000 00:00 0

0378f000-03790000 rw-p 00000000 00:00 0

037a0000-037c0000 rw-p 00000000 00:00 0

 

and the output while running the application (VNCCUmain)

 

root: /> cat proc/maps

002b0000-002be000 rw-p 00000000 00:00 0

002c0000-002c5000 rw-p 00000000 00:00 0

002c8000-002cd000 rw-p 00000000 00:00 0

002d0000-002d5000 rw-p 00000000 00:00 0

002d8000-002dd000 rw-p 00000000 00:00 0

002e0000-002e5000 rw-p 00000000 00:00 0

002e8000-002ed000 rw-p 00000000 00:00 0

002f0000-002f5000 rw-p 00000000 00:00 0

002f8000-002fd000 rw-p 00000000 00:00 0

00300000-00304000 r-xs 00000000 00:01 502 /usr/lib/qt/gfxdrivers/libqvnccuscreen.so

00304000-00305000 rw-p 00000000 00:00 0

00305000-00306000 r-xs 00000000 00:01 777 /lib/librt.so.0

00308000-0030d000 r-xs 00000000 00:01 496 /usr/lib/qt/imageformats/libqgif.so

00312000-00314000 r-xs 00000000 00:01 780 /lib/libdl.so.0

00314000-00315000 rw-p 00000000 00:00 0

00315000-00316000 rw-p 00000000 00:00 0

00316000-00317000 rw-p 00000000 00:00 0

00317000-00318000 rw-p 00000000 00:00 0

00318000-00319000 rw-p 00000000 00:00 0

0031a000-0031c000 rw-p 00000000 00:00 0

0031c000-0031e000 rw-p 00000000 00:00 0

0031e000-00320000 rw-p 00000000 00:00 0

00320000-00322000 rw-p 00000000 00:00 0

00322000-00322400 rw-S 00000000 00:04 65536 /SYSV00000000 (deleted)

00326000-00328000 rw-p 00000000 00:00 0

0032b000-0032c000 r--s 00000000 00:01 528 /usr/lib/fonts/helvetica_120_75.qpf

0032c000-0032e000 rw-p 00000000 00:00 0

0032e000-00330000 rw-p 00000000 00:00 0

00330000-0033e000 rw-p 00000000 00:00 0

00340000-00345000 rw-p 00000000 00:00 0

00348000-0034b000 rw-p 00000000 00:00 0

0034c000-0034f000 rw-p 00000000 00:00 0

00350000-00355000 rw-p 00000000 00:00 0

00358000-0035b000 rw-p 00000000 00:00 0

0035c000-0035f000 rw-p 00000000 00:00 0

00362000-00364000 rw-p 00000000 00:00 0

00364000-00368000 rw-p 00000000 00:00 0

00368000-0036a000 rw-p 00000000 00:00 0

0036c000-00370000 rw-p 00000000 00:00 0

00370000-00373000 r-xs 00000000 00:01 498 /usr/lib/qt/imageformats/libqsvg.so

00374000-00376000 rw-p 00000000 00:00 0

00376000-00378000 r--s 00000000 00:01 533 /usr/lib/fonts/helvetica_240_75.qpf

00378000-0037b000 rw-p 00000000 00:00 0

0037c000-0037f000 rw-p 00000000 00:00 0

00384000-00387000 rw-p 00000000 00:00 0

0038a000-0038c000 rw-p 00000000 00:00 0

0038c000-0038d000 rw-p 00000000 00:00 0

0038d000-0038e000 rw-p 00000000 00:00 0

0038e000-00390000 rw-p 00000000 00:00 0

00390000-00391000 rw-p 00000000 00:01 781 /lib/libutil.so.0

00392000-00394000 rw-p 00000000 00:00 0

00396000-00398000 rw-p 00000000 00:00 0

00398000-0039d000 rw-p 00000000 00:00 0

003a0000-003a3000 rw-p 00000000 00:00 0

003a4000-003a7000 rw-p 00000000 00:00 0

003a8000-003ab000 rw-p 00000000 00:00 0

003ac000-003ad000 rw-p 00000000 00:00 0

003ad000-003ae000 rw-p 00000000 00:00 0

003ae000-003af000 rw-p 00000000 00:00 0

003af000-003b0000 rw-p 00000000 00:00 0

003b0000-003b1000 rw-p 00000000 00:00 0

003b1000-003b2000 rw-p 00000000 00:00 0

003b2000-003b3000 rw-p 00000000 00:00 0

003b3000-003b4000 rw-p 00000000 00:00 0

003b4000-003b5000 rw-p 00000000 00:00 0

003b5000-003b6000 rw-p 00000000 00:00 0

003b6000-003b7000 rw-p 00000000 00:00 0

003b7000-003b8000 rw-p 00000000 00:00 0

003b8000-003b9000 rw-p 00000000 00:00 0

003b9000-003ba000 rw-p 00000000 00:00 0

003ba000-003bb000 rw-p 00000000 00:00 0

003bb000-003bc000 rw-p 00000000 00:00 0

003bc000-003bd000 rw-p 00000000 00:00 0

003be000-003bf000 rw-p 00000000 00:00 0

003bf000-003c0000 rw-p 00000000 00:00 0

003c0000-003c5000 rw-p 00000000 00:00 0

003c8000-003cd000 rw-p 00000000 00:00 0

003d0000-003d5000 rw-p 00000000 00:00 0

003d8000-003dd000 rw-p 00000000 00:00 0

003e0000-003e5000 rw-p 00000000 00:00 0

003e8000-003ed000 rw-p 00000000 00:00 0

003f0000-003f3000 rw-p 00000000 00:00 0

003f7000-003f8000 rw-p 00000000 00:00 0

003f8000-003fb000 rw-p 00000000 00:00 0

003fc000-003ff000 rw-p 00000000 00:00 0

00820000-00823000 rw-p 00000000 00:00 0

00824000-00827000 rw-p 00000000 00:00 0

00828000-00829000 rw-p 00000000 00:00 0

00829000-0082a000 rw-p 00000000 00:00 0

0082a000-0082b000 rw-p 00000000 00:00 0

0082b000-0082c000 rw-p 00000000 00:00 0

0082c000-0082d000 rw-p 00000000 00:00 0

0082d000-0082e000 rw-p 00000000 00:00 0

0082e000-0082f000 rw-p 00000000 00:00 0

0082f000-00830000 rw-p 00000000 00:00 0

00830000-00831000 rw-p 00000000 00:00 0

00832000-00834000 rw-p 00000000 00:00 0

00834000-00836000 rw-p 00000000 00:00 0

00836000-00837000 rw-p 00000000 00:00 0

00837000-00838000 rw-p 00000000 00:00 0

00838000-0083d000 rw-p 00000000 00:00 0

00840000-00845000 rw-p 00000000 00:00 0

00848000-0084b000 rw-p 00000000 00:00 0

0084c000-0084f000 rw-p 00000000 00:00 0

00850000-00855000 rw-p 00000000 00:00 0

00858000-0085d000 rw-p 00000000 00:00 0

00860000-00863000 rw-p 00000000 00:00 0

00864000-00867000 rw-p 00000000 00:00 0

00868000-0086d000 rw-p 00000000 00:00 0

00870000-00875000 rw-p 00000000 00:00 0

00878000-0087b000 rw-p 00000000 00:00 0

0087c000-0087f000 rw-p 00000000 00:00 0

00880000-008a0000 rw-p 00000000 00:00 0

008a0000-008a5000 rw-p 00000000 00:00 0

00900000-009aa000 r-xs 00000000 00:01 722 /lib/libstdc++.so.6

00a00000-00b01000 rw-p 00000000 00:00 0

00c00000-00e45000 r-xs 00000000 00:01 486 /usr/lib/libQtCore.so.4

01000000-01058000 rw-p 00000000 00:00 0

01080000-01085000 rw-p 00000000 00:00 0

01088000-0108d000 r-xs 00000000 00:01 497 /usr/lib/qt/imageformats/libqico.so

01092000-01094000 rw-p 00000000 00:00 0

01097000-01098000 rw-p 00000000 00:00 0

01098000-010a0000 rw-p 00000000 00:00 0

010a0000-010bd000 r-xs 00000000 00:01 495 /usr/lib/qt/imageformats/libqjpeg.so

010c0000-010c5000 rw-p 00000000 00:00 0

010c8000-010cd000 rw-p 00000000 00:00 0

010d0000-010d5000 rw-p 00000000 00:00 0

010d8000-010dd000 rw-p 00000000 00:00 0

010e0000-010e5000 rw-p 00000000 00:00 0

010e8000-010ed000 rw-p 00000000 00:00 0

010f0000-010f5000 rw-p 00000000 00:00 0

010f8000-010f9000 rw-p 00000000 00:00 0

010f9000-010fa000 rw-p 00000000 00:00 0

010fa000-010fb000 rw-p 00000000 00:00 0

010fb000-010fc000 rw-p 00000000 00:00 0

010fc000-010ff000 rw-p 00000000 00:00 0

01100000-01131000 r-xs 00000000 00:01 539 /usr/lib/libQtXml.so.4

01140000-01141000 rw-p 00000000 00:00 0

01141000-01142000 rw-p 00000000 00:00 0

01142000-01143000 rw-p 00000000 00:00 0

01143000-01144000 rw-p 00000000 00:00 0

01147000-01148000 r-xs 00000000 00:01 781 /lib/libutil.so.0

01148000-01149000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

01149000-0114a000 rw-p 00000000 00:00 0

0114c000-0114e000 rw-p 00000000 00:00 0

0114e000-0114f000 rw-p 00000000 00:00 0

0114f000-01150000 rw-p 00000000 00:00 0

01150000-01152000 rw-p 00000000 00:00 0

01152000-01154000 rw-p 00000000 00:00 0

01154000-01156000 rw-p 00000000 00:00 0

01158000-01159000 rw-p 00000000 00:00 0

01160000-0117d000 rw-p 00000000 00:00 0

01180000-011de000 r-xs 00000000 00:01 2272 /VNCCUmain

01200000-01240000 r-xs 00000000 00:01 538 /usr/lib/libQtSvg.so.4

01240000-01241000 rw-p 00000000 00:01 777 /lib/librt.so.0

01241000-01242000 rw-p 00000000 00:00 0

01242000-01243000 rw-p 00000000 00:00 0

01243000-01244000 rw-p 00000000 00:00 0

01244000-01246000 rw-p 00000000 00:00 0

01246000-01247000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

01248000-01250000 rw-p 00000000 00:00 0

01250000-01252000 rw-p 00004000 00:01 717 /bin/telnetd

01254000-01258000 rw-p 0003a000 00:01 659 /bin/busybox

01258000-0125d000 rw-p 00000000 00:00 0

01260000-01280000 rw-p 00000000 00:00 0

01280000-01285000 rw-p 00000000 00:00 0

01288000-0128a000 rw-p 00000000 00:00 0

0128a000-0128b000 rw-p 00000000 00:00 0

0128b000-0128c000 rw-p 00000000 00:00 0

0128c000-0128d000 rw-p 00000000 00:00 0

01290000-01299000 r-xs 00000000 00:01 723 /lib/libpthread.so.0

012a0000-012c0000 rw-p 00000000 00:00 0

012c0000-012e5000 rw-p 00000000 00:00 0

01400000-01475000 r-xs 00000000 00:01 505 /usr/lib/libQtNetwork.so.4

01480000-01485000 r-xs 00000000 00:01 717 /bin/telnetd

01488000-01489000 rw-p 00000000 00:00 0

01489000-0148a000 rw-p 00000000 00:00 0

0148a000-0148c000 rw-p 00000000 00:00 0

0148f000-01490000 rw-p 00000000 00:00 0

01490000-0149e000 r-xs 00000000 00:01 726 /lib/libz.so.1

014a0000-014a5000 rw-p 00000000 00:00 0

014a8000-014ab000 rw-p 00000000 00:00 0

014ac000-014af000 rw-p 00000000 00:00 0

014b0000-014b5000 rw-p 00000000 00:00 0

014b8000-014bb000 rw-p 00000000 00:00 0

014bc000-014bf000 rw-p 00000000 00:00 0

014c0000-014c3000 rw-p 00000000 00:00 0

014c4000-014c7000 rw-p 00000000 00:00 0

014c8000-014cd000 rw-p 00000000 00:00 0

014d0000-014d3000 rw-p 00000000 00:00 0

014d4000-014d7000 rw-p 00000000 00:00 0

014d8000-014dd000 rw-p 00000000 00:00 0

014e0000-014e3000 rw-p 00000000 00:00 0

014e4000-014e7000 rw-p 00000000 00:00 0

014e8000-014ed000 rw-p 00000000 00:00 0

014f0000-014f1000 rw-p 00000000 00:00 0

014f1000-014f2000 rw-p 00000000 00:00 0

014f2000-014f3000 rw-p 00000000 00:00 0

014f7000-014f8000 rw-p 00000000 00:00 0

014f8000-014fc000 rw-p 0003a000 00:01 659 /bin/busybox

014fc000-014fd000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

01500000-0151d000 r-xs 00000000 00:01 541 /usr/lib/libpng12.so.0

01520000-0152f000 r-xs 00000000 00:01 776 /lib/libm.so.0

015d9000-015da000 rw-p 00000000 00:00 0

015da000-015dc000 rw-p 00000000 00:00 0

015dc000-015dd000 rw-p 00000000 00:00 0

015dd000-015de000 rw-p 00000000 00:00 0

015de000-015df000 rw-p 00000000 00:00 0

015df000-015e0000 rw-p 00000000 00:00 0

015e0000-01600000 rwxp 00000000 00:00 0

01600000-0175e000 rw-p 00000000 00:00 0

01800000-01fc7000 r-xs 00000000 00:01 508 /usr/lib/libQtGui.so.4

02055000-02056000 rw-p 00000000 00:00 0

020d8000-020d9000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

020d9000-020da000 rw-p 00000000 00:00 0

020de000-020df000 rw-p 00000000 00:00 0

020df000-020e0000 rw-p 00000000 00:00 0

034b5000-034b6000 rw-p 00002000 00:01 679 /bin/init

034b6000-034b7000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

034c6000-034c7000 rw-p 00000000 00:00 0

034c8000-034cb000 r-xs 00000000 00:01 679 /bin/init

034ce000-034d0000 rw-p 00000000 00:00 0

034d0000-034d5000 r-xs 00000000 00:01 728 /lib/ld-uClibc.so.0

034d8000-034db000 r-xs 00000000 00:01 724 /lib/libcrypt.so.0

034dc000-034e0000 rw-p 0003a000 00:01 659 /bin/busybox

034e0000-03500000 rw-p 00000000 00:00 0

03500000-03512000 rw-p 00000000 00:00 0

03520000-0352e000 r-xs 00000000 00:01 774 /lib/libgcc_s.so.1

03530000-03535000 rw-p 00000000 00:00 0

03538000-0353c000 rw-p 0003a000 00:01 659 /bin/busybox

0353e000-0353f000 rw-p 00002000 00:01 590 /bin/inetd

03540000-0357b000 r-xs 00000000 00:01 772 /lib/libc.so.0

03580000-035bb000 r-xs 00000000 00:01 659 /bin/busybox

035c0000-035e0000 rw-p 00000000 00:00 0

035e1000-035e2000 rw-p 00000000 00:00 0

035e2000-035e3000 rw-p 00002000 00:01 590 /bin/inetd

035e3000-035e4000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e4000-035e5000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e5000-035e6000 rw-p 00000000 00:00 0

035e6000-035e7000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035e7000-035e8000 rw-p 00000000 00:00 0

035ea000-035eb000 rw-p 00000000 00:00 0

035f0000-035f2000 rw-p 00000000 00:00 0

035f3000-035f4000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

035f6000-035f8000 rw-p 00000000 00:00 0

035f8000-035fd000 rw-p 00000000 00:00 0

03600000-03620000 rw-p 00000000 00:00 0

03622000-03623000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

036b8000-036bb000 r-xs 00000000 00:01 590 /bin/inetd

036bc000-036bd000 rw-p 00004000 00:01 728 /lib/ld-uClibc.so.0

036bd000-036be000 rw-p 00000000 00:00 0

036be000-036bf000 rw-p 00000000 00:00 0

036bf000-036c0000 rw-p 00000000 00:00 0

036c0000-036e0000 rw-p 00000000 00:00 0

036e0000-036e4000 rw-p 0003a000 00:01 659 /bin/busybox

036e4000-036e8000 rw-p 0003a000 00:01 659 /bin/busybox

036ea000-036eb000 rw-p 00000000 00:00 0

036eb000-036ec000 rw-p 00000000 00:00 0

036ec000-036ed000 rw-p 00000000 00:00 0

036f0000-036f5000 rw-p 00000000 00:00 0

036f9000-036fa000 rw-p 00000000 00:00 0

036fc000-036fe000 rw-p 00000000 00:00 0

036fe000-03700000 rw-p 00000000 00:00 0

03700000-03720000 rw-p 00000000 00:00 0

03720000-03740000 rw-p 00000000 00:00 0

03740000-03760000 rw-p 00000000 00:00 0

03760000-03765000 rw-p 00000000 00:00 0

03768000-0376d000 rw-p 00000000 00:00 0

03770000-03772000 rw-p 00000000 00:00 0

03772000-03773000 rw-p 00000000 00:00 0

03778000-0377d000 rw-p 00000000 00:00 0

03780000-03785000 rw-p 00000000 00:00 0

0378c000-0378e000 rw-p 00000000 00:00 0

0378f000-03790000 rw-p 00000000 00:00 0

03790000-03791000 rw-p 00000000 00:00 0

03791000-03792000 rw-p 00000000 00:00 0

03792000-03793000 rw-p 00000000 00:00 0

03793000-03794000 rw-p 00000000 00:00 0

03798000-0379d000 rw-p 00000000 00:00 0

037a0000-037b3000 rw-p 0005d000 00:01 2272 /VNCCUmain

 

 

I gues the 0 entries are stack, heap, files in filesystem, some buffers or is it free space?

Ok so the application loads the QtGui library in to another sagment of system memory(01800000-01fc7000), which was free before

(015da000-015dc000 rw-p 00000000 00:00 0

02055000-02056000 rw-p 00000000 00:00 0 )?.

 

But it is already there as a file in the filesystem. Why was it loaded again?

Thanks for helping me to understand.

QuoteReplyEditDelete

 

 

2011-03-10 10:21:11     Re: Memory problem - QT - initramfs - xip

Steve Strobel (UNITED STATES)

Message: 98849   

 

> QT libraries are shared...

 

I don't have any experiece with Qt, but I have seen memory savings when linking other libraries statically rather than as shared objects.  I presume that static linking allows unused routines to be omitted.  Maybe the same would help in your case.

 

Steve

QuoteReplyEditDelete

 

 

2011-03-10 23:51:22     Re: Memory problem - QT - initramfs - xip

Sonic Zhang (CHINA)

Message: 98868   

 

You should avoid use initramfs in this case. Enable USBFS support in kernel and put your rootfs ubifs image into one partition on your SPI flash.  And mount that partition as your rootfs when boot kernel.

QuoteReplyEditDelete

 

 

2011-03-21 10:58:12     Re: Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 99100   

 

Hello,

to put the filesystem into SPI flash is unfortunately not really an option for us.

Why should we avoid using initramfs?

 

After some days trying to build QT, our plugins and the application as static we end up with:

 

root:/>./myapp -qws

page allocation failure. order:12, mode:0xd0

...

Allocation of length 8569844 from process 405 (myapp) failed

...

 

Anyway, we dont want to use static objects.

 

Do you have any other tips, or hints how to get xip working?

QuoteReplyEditDelete

 

 

2011-03-22 00:05:16     Re: Memory problem - QT - initramfs - xip

Sonic Zhang (CHINA)

Message: 99112   

 

Because initramfs put all rootfs in the DRAM. If your root fs is 10M bytes, you lose 10M free memory after kernel boot.

 

Putting rootfs to SPI/NOR/NAND flash free these memory for you.

QuoteReplyEditDelete

 

 

2011-04-08 10:46:19     Re: Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 99700   

 

Hi again,

 

as i wasnt successful with my XIP mission, i tried to reorganize my application and my flash so the image and filesystem would fit into the SPI flash.

 

I managed to boot the vmImage and jffs2 filesystem without errors but:

 

- mounting the filesystem takes like 40s

- simple tftp operation (0,5MB) took some seconds as well

- when i started my qt app nothing happend i saw that the memory consumption rises and than after a minute or so it crashes with page allocation failure and ./QTapp:582: can't map '/usr/lib/libQtGui.so.4' ....

 

This is what i did:

 

1. i build an image with jffs2(write buffering support, summary), yaffs2 support

2. organize the partitions so everything would fit

- vmImage - 1,3MB

- rootfs.jffs2 - 8,1MB

- rootfs.yaffs2 - 15,7MB - this obviously wont fit

- QTapp - 0,5MB

 

Partitions:

Creating 3 MTD partitions on "m25p128":

0x00000000-0x00100000 : "DSP Flash(spi)"

0x00100000-0x00400000 : "linux kernel(spi)"

0x00400000-0x00e00000 : "linux filesystem(spi)"

 

3. I erased the SPI flash and saved u-boot, vmImage and rootfs.jffs2 each into separed partition.

(i did build the rootfs.jffs2 with the option -e 0x40000)

4. In U-boot i used following bootargs root=/dev/mtdblock2 rw rootfstype=jffs2 clkin_hz=24000000 earlyprintk=serial,uart1,57600 console=tty0 console=ttyBF1,57600

5. I started the kernel. The booting was without errors, it just took ages till the shell get active - filesystem was mounted.

6. Then i wanted to load my app over tftp, it worked but it took like 30 seconds(0,5MB).

7. I started my app. The console was inactive so i get connection to the board via telnet to see whats going on. I sow that the memory consuption was higher with every command: free till it reaches the 62MB and than it crashes.

 

Do you have any idea what i did wrong?

 

PS: the spi is set up to 20MHz.

QuoteReplyEditDelete

 

 

2011-04-08 12:39:42     Re: Memory problem - QT - initramfs - xip

Mike Frysinger (UNITED STATES)

Message: 99703   

 

sounds like you should be using jffs2 summary support

 

what speed hz did you register in your board resources for the spi flash ?

QuoteReplyEditDelete

 

 

2011-04-11 00:31:26     Re: Memory problem - QT - initramfs - xip

Sonic Zhang (CHINA)

Message: 99735   

 

Why not include your QT application in the your jffs2 root image other than tftp it? tftp may consume extra page buffers.

QuoteReplyEditDelete

 

 

2011-04-18 05:08:12     Re: Memory problem - QT - initramfs - xip

J V (GERMANY)

Message: 99938   

 

Hello,

with the summary support it was better. I was able to run my application and after cleaning cache with "echo 1 > /proc/sys/vm/drop_caches" i got some more memory. Not that much that i was expecting - only 10MB more in compare to initramfs.

But still it is useless in real application. Mounting the image takes 15s and the application starts something like 3s slower. You cannot let user wait more than half a minute till his embedded device starts.

The tftp thing was not the problem, it was only an example. But with summary it is faster.

 

The SPI is configured for 25MHz.

 

Do you have any other hints/ideas about XIP or saving some memory?

thanks

QuoteReplyEditDelete

 

 

2011-04-18 06:00:40     Re: Memory problem - QT - initramfs - xip

Aaron Wu (CHINA)

Message: 99940   

 

You could do some boot up time consuming profile, you may use tools like described in   elinux.org/Grabserial  to time stamp the console log to find out where the bottle neck is. More general information for boot up time here:   elinux.org/Boot_Time.  More information on our wiki:   docs.blackfin.uclinux.org/doku.php?id=fast_boot_example&s[]=fastboot

QuoteReplyEditDelete

 

 

2011-04-19 17:56:05     Re: Memory problem - QT - initramfs - xip

Mike Frysinger (UNITED STATES)

Message: 100007   

 

are you using DMA on the spi flash ?  we've seen that speed things up.

Attachments

    Outcomes