Confusing DebugDiag report to identify High Memory usage - wcf

Recently I got a new batch of dumps to identify the HighMemory usage in 3 of our WCF Services. Which are hosted on 64Bit AppPool and Windows Server 2012.
Application one :
ProcessUp Time : 22 days
GC Heap usage : 2.69 Gb
Loaded Modules : 220 Mb
Commited Memory : 3.08 Gb
Native memory : 2 Gb
Issue identified as large GC heap usage is due to un closed WCF client proxy objects. Which are accounting for almost 2.26 Gb and rest for cache in GC heap.
Application Two :
ProcessUp Time : 9 Hours
GC Heap usage : 4.43 Gb
Cache size : 2.45 Gb
Loaded Modules : 224 Mb
Commited Memory : 5.13 Gb
Native memory heap : 2 Gb
Issue identified as most of the objects are of System.Web.CaheEntry, as they are due to large cache size. 2.2 Gb of String object on Gc heap has roots to CacheRef root objects.
Application Three :
Cache size : 950 Mb
GC heap : 1.2 Gb
Native Heap : 2 Gb
We recently upgrade to Windows Server 2012, I had old dumps as well. Those dumps does not show the native heap for the same application. It was only around 90 Mb.
I also use WinDbg to explore the Native heap with !heap -s command.
which shows very minimal native heap sizes as shown below.
I am just confused Why DebugDiag 2.0 is showing 2Gb of Native Heap in every WCF service. My understand is that !heap -s should also dump the same native heaps and it should match the debug diag reports graphs. Report also shows values in Thoushand of TBytes.
0:000> !heap -s
LFH Key : 0x53144a890e31e98b
Termination on corruption : ENABLED
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-------------------------------------------------------------------------------------
000000fc42c10000 00000002 32656 31260 32552 2885 497 6 2 f LFH
000000fc42a40000 00008000 64 4 64 2 1 1 0 0
000000fc42bf0000 00001002 3228 1612 3124 43 9 3 0 0 LFH
000000fc43400000 00001002 1184 76 1080 1 5 2 0 0 LFH
000000fc43390000 00001002 1184 148 1080 41 7 2 0 0 LFH
000000fc43d80000 00001002 60 8 60 5 1 1 0 0
000000fc433f0000 00001002 60 8 60 5 1 1 0 0
000000fc442a0000 00001002 1184 196 1080 1 6 2 0 0 LFH
000000fc44470000 00041002 60 8 60 5 1 1 0 0
000001008e9f0000 00041002 164 40 60 3 1 1 0 0 LFH
000001008f450000 00001002 3124 1076 3124 1073 3 3 0 0
External fragmentation 99 % (3 free blocks)
-------------------------------------------------------------------------------------
Can anybody explain me why WinDbg command !heap -s and DebugDiag report is varing. Or I have incorrect knowledge of above command.
I also use Pykd script to dump native object stats. Which does not show much large number of objects.
Also what is mean by External fragmentation 99 % (3 free blocks)
in above output. I understand that fragmented memory has less large block of continuous memory place. But fail to relate it with Percentage.
Edit 1 :
Application 2 :
0:000> !address -summary
Mapping file section regions...
Mapping module regions...
Mapping PEB regions...
Mapping TEB and stack regions...
Mapping heap regions...
Mapping page heap regions...
Mapping other regions...
Mapping stack trace database regions...
Mapping activation context regions...
--- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
Free 363 7ffb`04a14000 ( 127.981 Tb) 99.98%
<unknown> 952 4`e8c0c000 ( 19.637 Gb) 98.54% 0.01%
Image 2122 0`0e08d000 ( 224.551 Mb) 1.10% 0.00%
Heap 88 0`03372000 ( 51.445 Mb) 0.25% 0.00%
Stack 124 0`013c0000 ( 19.750 Mb) 0.10% 0.00%
Other 7 0`001be000 ( 1.742 Mb) 0.01% 0.00%
TEB 41 0`00052000 ( 328.000 kb) 0.00% 0.00%
PEB 1 0`00001000 ( 4.000 kb) 0.00% 0.00%
--- Type Summary (for busy) ------ RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_PRIVATE 643 4`ebf44000 ( 19.687 Gb) 98.79% 0.02%
MEM_IMAGE 2655 0`0eb96000 ( 235.586 Mb) 1.15% 0.00%
MEM_MAPPED 37 0`00b02000 ( 11.008 Mb) 0.05% 0.00%
--- State Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_FREE 363 7ffb`04a14000 ( 127.981 Tb) 99.98%
MEM_RESERVE 725 3`b300d000 ( 14.797 Gb) 74.25% 0.01%
MEM_COMMIT 2610 1`485cf000 ( 5.131 Gb) 25.75% 0.00%
--- Protect Summary (for commit) - RgnCount ----------- Total Size -------- %ofBusy %ofTotal
PAGE_READWRITE 868 1`3939d000 ( 4.894 Gb) 24.56% 0.00%
PAGE_EXECUTE_READ 157 0`09f10000 ( 159.063 Mb) 0.78% 0.00%
PAGE_READONLY 890 0`035ed000 ( 53.926 Mb) 0.26% 0.00%
PAGE_WRITECOPY 433 0`0149c000 ( 20.609 Mb) 0.10% 0.00%
PAGE_EXECUTE_READWRITE 148 0`0065d000 ( 6.363 Mb) 0.03% 0.00%
PAGE_EXECUTE_WRITECOPY 67 0`0017c000 ( 1.484 Mb) 0.01% 0.00%
PAGE_READWRITE|PAGE_GUARD 41 0`000b9000 ( 740.000 kb) 0.00% 0.00%
PAGE_NOACCESS 4 0`00004000 ( 16.000 kb) 0.00% 0.00%
PAGE_EXECUTE 2 0`00003000 ( 12.000 kb) 0.00% 0.00%
--- Largest Region by Usage ----------- Base Address -------- Region Size ----------
Free 101`070a0000 7ef6`e77b2000 ( 126.964 Tb)
<unknown> fd`72f14000 0`d156c000 ( 3.271 Gb)
Image 7ff9`91344000 0`012e8000 ( 18.906 Mb)
Heap 100`928a0000 0`00544000 ( 5.266 Mb)
Stack fc`43240000 0`0007b000 ( 492.000 kb)
Other fc`42ea0000 0`00181000 ( 1.504 Mb)
TEB 7ff7`ee852000 0`00002000 ( 8.000 kb)
PEB 7ff7`eeaaf000 0`00001000 ( 4.000 kb)
Application Three :
0:000> !address -summary
--- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
Free 323 7ffb`9f8ea000 ( 127.983 Tb) 99.99%
<unknown> 832 4`4bbb6000 ( 17.183 Gb) 98.15% 0.01%
Image 2057 0`0e5ab000 ( 229.668 Mb) 1.28% 0.00%
Heap 196 0`04f52000 ( 79.320 Mb) 0.44% 0.00%
Stack 127 0`01440000 ( 20.250 Mb) 0.11% 0.00%
Other 7 0`001be000 ( 1.742 Mb) 0.01% 0.00%
TEB 42 0`00054000 ( 336.000 kb) 0.00% 0.00%
PEB 1 0`00001000 ( 4.000 kb) 0.00% 0.00%
--- Type Summary (for busy) ------ RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_PRIVATE 783 4`51099000 ( 17.266 Gb) 98.63% 0.01%
MEM_IMAGE 2444 0`0ec06000 ( 236.023 Mb) 1.32% 0.00%
MEM_MAPPED 35 0`00a67000 ( 10.402 Mb) 0.06% 0.00%
--- State Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_FREE 323 7ffb`9f8ea000 ( 127.983 Tb) 99.99%
MEM_RESERVE 621 3`e3504000 ( 15.552 Gb) 88.83% 0.01%
MEM_COMMIT 2641 0`7d202000 ( 1.955 Gb) 11.17% 0.00%
--- Protect Summary (for commit) - RgnCount ----------- Total Size -------- %ofBusy %ofTotal
PAGE_READWRITE 919 0`6dc07000 ( 1.715 Gb) 9.80% 0.00%
PAGE_EXECUTE_READ 153 0`0a545000 ( 165.270 Mb) 0.92% 0.00%
PAGE_READONLY 734 0`02cf5000 ( 44.957 Mb) 0.25% 0.00%
PAGE_WRITECOPY 470 0`01767000 ( 23.402 Mb) 0.13% 0.00%
PAGE_EXECUTE_READWRITE 240 0`009cf000 ( 9.809 Mb) 0.05% 0.00%
PAGE_EXECUTE_WRITECOPY 76 0`001c5000 ( 1.770 Mb) 0.01% 0.00%
PAGE_READWRITE|PAGE_GUARD 42 0`000be000 ( 760.000 kb) 0.00% 0.00%
PAGE_NOACCESS 5 0`00005000 ( 20.000 kb) 0.00% 0.00%
PAGE_EXECUTE 2 0`00003000 ( 12.000 kb) 0.00% 0.00%
--- Largest Region by Usage ----------- Base Address -------- Region Size ----------
Free 52`892e0000 7fa5`65548000 ( 127.646 Tb)
<unknown> 4f`4ec81000 0`e9c3f000 ( 3.653 Gb)
Image 7ff9`91344000 0`012e8000 ( 18.906 Mb)
Heap 52`8833b000 0`00fa4000 ( 15.641 Mb)
Stack 4e`37a70000 0`0007b000 ( 492.000 kb)
Other 4e`37720000 0`00181000 ( 1.504 Mb)
TEB 7ff7`ee828000 0`00002000 ( 8.000 kb)
PEB 7ff7`eea43000 0`00001000 ( 4.000 kb)

Related

Can't access the entire page using Beautiful Soup and Selenium

I have been trying to gather data using beautiful soup and selenium and have been unable to get more than the first 20 results on the table (there are over 2000 total). I saw some related questions and answers which suggested trying different parsers, so I tried lxml, html.parser and html5lib, but none worked. I also saw some answers suggesting to use selenium and webdriver but wasn't able to get the entire page using either. This is my code as of right now
import requests, time
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import urllib.request
#import pandas as pd
from bs4 import BeautifulSoup
import requests, time
import lxml
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://coinmarketcap.com/exchanges/uniswap-v2/')
#supposed to scroll to the bottom of the page
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(5)
page = driver.page_source
soup = BeautifulSoup(''.join(page), 'lxml')
pairs = soup.find_all('div', attrs = {"class" : "hmd6df-0 kCRNNr"})
data = [i.find_all('a')[0] for i in pairs]
Any help would be awesome. Thanks.
I have come up with a purely selenium solution - the following python script successfully scrapes all the data from the table. I am just printing like this as an example, you will want to figure out how to organize your data.
Update: in order to expand and scrape all the rows, I am scrolling to the bottom of the list, then clicking the "Expand More" button, which expands 100 more rows. I am iterating this enough times to get all the way through the 1850 rows of data.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://coinmarketcap.com/exchanges/uniswap-v2/')
total_height = int(driver.execute_script("return document.body.scrollHeight"))
for x in range(20):
for i in range(1, total_height, 130):
driver.execute_script("window.scrollTo(0, {});".format(i))
if x == 0:
driver.find_element_by_css_selector('div.cmc-cookie-policy-banner__close').click()
driver.find_element_by_xpath('//button[text() = "Load More"]').click()
time.sleep(2)
first_column = driver.find_elements_by_css_selector('td.cmc-table__cell.cmc-table__cell--sticky.cmc-table__cell--sortable.cmc-table__cell--left.cmc-table__cell--sort-by__rank > div')
second_column = driver.find_elements_by_css_selector('div.cwwgik-0.bCvAgC')
third_column = driver.find_elements_by_css_selector('div.hmd6df-0.kCRNNr')
fourth_column = driver.find_elements_by_css_selector('div.cmc-table__column-market-pair-volume-24h')
fifth_column = driver.find_elements_by_css_selector('div.cmc-table__column-market-pair-volume-percent')
sixth_column = driver.find_elements_by_css_selector('td.cmc-table__cell.cmc-table__cell--sortable.cmc-table__cell--right.cmc-table__cell--sort-by__quote-usd-effective-liquidity > div')
seventh_column = driver.find_elements_by_css_selector('td.cmc-table__cell.cmc-table__cell--sortable.cmc-table__cell--right.cmc-table__cell--sort-by__fee-type > div')
eighth_column = driver.find_elements_by_css_selector('div.ghkc60-0.fLaXDt')
for i in range(len(second_column)):
print(str(first_column[i].get_attribute("innerText")) + ' ' + str(second_column[i].get_attribute("innerText")) + ' ' + str(third_column[i].get_attribute("innerText")) + ' ' + str(fourth_column[i].get_attribute("innerText")) + ' ' + str(fifth_column[i].get_attribute("innerText")) + ' ' + str(sixth_column[i].get_attribute("innerText")) + ' ' + str(seventh_column[i].get_attribute("innerText")) + ' ' + str(eighth_column[i].get_attribute("innerText")))
Output:
1 USD Coin USDC/WETH $250,651,977 20.81% 935 Percentage Recently
2 Fei Protocol FEI/WETH $157,435,972 13.07% - Percentage Recently
3 WETH WETH/USDT $153,706,066 12.76% 915 Percentage Recently
4 Dai DAI/WETH $58,995,907 4.90% 850 Percentage Recently
5 Tendies TEND/WETH $41,429,102 3.44% - Percentage 778 hours ago
6 Wrapped Bitcoin WBTC/WETH $37,838,161 3.14% 901 Percentage Recently
7 SHIBA INU SHIB/WETH $30,416,126 2.53% 612 Percentage Recently
...
1770 yplutus yPLT/WETH $? 0.00% - Percentage 671 hours ago
1771 Deflect DEFLCT/RFI $? 0.00% - Percentage 96 days ago
1772 Blaze DeFi BNFI/WETH $? 0.00% - Percentage 781 hours ago
1773 Buy-Sell BSE/WETH $? 0.00% - Percentage Recently
1774 PIRANHAS $PIR/WETH $? 0.00% - Percentage Recently
1775 HLand Token HLAND/USDT $? 0.00% - Percentage Recently
1776 Hub - Human Trust Protocol HUB/WETH $? 0.00% - Percentage 126 days ago
1777 WETH WETH/YVS $? 0.00% - Percentage Recently
1778 Reflector.Finance RFCTR/WETH $? 0.00% - Percentage Recently
1779 WETH WETH/R34P $? 0.00% - Percentage Recently
1780 WETH WETH/RFR $? 0.00% 265 Percentage Recently
1781 Golden Ratio Per Liquidity GRPL/WETH $? 0.00% - Percentage Recently
1782 xETH-G xETH-G/WETH $? 0.00% - Percentage 75 days ago
1783 3XT TOKEN 3XT/WETH $? 0.00% - Percentage 62 days ago
1784 Diffract Finance DFR/WETH $? 0.00% - Percentage Recently
1785 Bitpower BPP/WETH $? 0.00% - Percentage Recently
1786 IDL Token IDL/ELYX $? 0.00% - Percentage 77 days ago
1787 IDL Token IDL/WETH $? 0.00% - Percentage 81 days ago
1788 Dai DAI/BCC $? 0.00% - Percentage 42 days ago
1789 Stand Share SAS/USDT $? 0.00% - Percentage 123 days ago
1790 Definex Dswap/USDT $? 0.00% - Percentage 314 hours ago
1791 Vaultz VAULTZ/WETH $? 0.00% - Percentage 781 hours ago
1792 Fission Cash FCX/WETH $? 0.00% - Percentage Recently
1793 DeltaHub Community DHC/USDT $? 0.00% - Percentage 821 hours ago
1794 Dai DAI/DST $? 0.00% - Percentage 111 days ago
1795 AGAr AGAr/WETH $? 0.00% - Percentage 311 hours ago
1796 Basis Cash BAC/Mars $? 0.00% - Percentage 809 hours ago
1797 Tether USDT/NOW $? 0.00% - Percentage 781 hours ago
1798 USD Coin USDC/wCUSD $? 0.00% - Percentage Recently
1799 zzz.finance v2 ZZZV2/WETH $? 0.00% - Percentage 781 hours ago
1800 Rigel Finance RIGEL/WETH $? 0.00% - Percentage Recently
1801 Bitbot Protocol BBP/WETH $? 0.00% - Percentage Recently
1802 HeroSwap HERO/WETH $? 0.00% - Percentage 108 days ago
1803 XUSD Stable XUSD/LINK $? 0.00% - Percentage 69 days ago
1804 XUSD Stable XUSD/DAI $? 0.00% - Percentage 96 days ago
1805 CURE Farm CURE/WETH $? 0.00% - Percentage Recently
1806 WETH WETH/stETH $? 0.00% 518 Percentage Recently
1807 Xstable.Protocol XST/WETH $? 0.00% - Percentage Recently
1808 ZCore WZCR/WETH $? 0.00% - Percentage 94 days ago
1811 Wrapped BIND wBIND/WETH $? 0.00% - Percentage Recently
1812 USDFreeLiquidity USDFL/USDT $? 0.00% - Percentage Recently
1813 USDFreeLiquidity USDFL/DAI $? 0.00% - Percentage 113 hours ago
1814 USDFreeLiquidity USDFL/USDN $? 0.00% - Percentage Recently
1815 WETH WETH/MCX $? 0.00% - Percentage Recently
1816 Mythic Finance MYTHIC/WETH $? 0.00% - Percentage 781 hours ago
1817 Polkabase PBASE/WETH $? 0.00% - Percentage Recently
1818 WETH WETH/RAC $? 0.00% - Percentage Recently
1819 MiraQle MQL/WETH $? 0.00% - Percentage 68 days ago
1820 MiraQle MQL/USDT $? 0.00% - Percentage 68 days ago
1821 Parsiq Boost PRQBOOST/WETH $? 0.00% - Percentage Recently
1822 WETH WETH/PUX $? 0.00% - Percentage Recently
1823 Previse PRVS/WETH $? 0.00% - Percentage Recently
1824 SIMBA Storage SIMBA/USDT $? 0.00% - Percentage 781 hours ago
1825 CryptoPing PING/USDT $? 0.00% - Percentage Recently
1826 Wrapped Bitcoin WBTC/INSTAR $? 0.00% - Percentage Recently
1827 Vow VOW/WETH $? 0.00% - Percentage Recently
1828 Value Set Dollar VSD/DAI $? 0.00% - Percentage 471 hours ago
1829 Value Set Dollar VSD/USDT $? 0.00% - Percentage 110 hours ago
1830 Value Set Dollar VSD/WETH $? 0.00% - Percentage 44 days ago
1831 WETH WETH/DEGENS $? 0.00% - Percentage Recently
1832 Xriba XRA/WETH $? 0.00% - Percentage 630 hours ago
1833 Tower token TOWER/LYM $? 0.00% - Percentage 469 hours ago
1834 Shadetech SHD/WETH $? 0.00% - Percentage Recently
1835 Wrapped Bitcoin WBTC/DGCL $? 0.00% - Percentage 333 hours ago
1836 Rare Pepe rPepe/WETH $? 0.00% - Percentage Recently
1837 xSigma SIG/USDT $? 0.00% - Percentage 52 days ago
1838 Dollar Protocol USDf/USDC $? 0.00% - Percentage 156 hours ago
1839 MYFinance MYFI/WETH $? 0.00% - Percentage Recently
1840 Delta DELTA/WETH $? 0.00% - Percentage Recently
1841 Kambria Yield Tuning Engine KYTE/WETH $? 0.00% - Percentage Recently
1842 ClinTex CTi CTI/WETH $? 0.00% - Percentage Recently
1843 BasenjiDAO BSJ/WETH $? 0.00% - Percentage Recently
1844 EURxb EURxb/USDT $? 0.00% - Percentage Recently
1845 Landbox LAND/WETH $? 0.00% - Percentage 442 hours ago
1846 Folder Protocol FOL/WETH $? 0.00% - Percentage Recently
1847 Databroker DTX/USDT $? 0.00% - Percentage Recently
1848 STATERA STA/WSTA $? 0.00% - Percentage Recently
1849 Delta Exchange Token DETO/WETH $? 0.00% - Percentage Recently
1850 Elongate Deluxe ELongD/WETH $? 0.00% - Percentage Recently

How to get the device memory or application size(Memory taken in Internal storage) using Appium

I have to get the details such as CPU, Memory(RAM), Battery, Startup time, App Size. Im able to get other things except App Size using Appium. Someone please help.
Thanks
Seems like Appium is not capable to perform this for you. However, you can check the memory usage in Android using adb:
$ adb shell dumpsys meminfo com.android.systemui
Which returns something like this:
Applications Memory Usage (in Kilobytes):
Uptime: 433213978 Realtime: 631179899
** MEMINFO in pid 1541 [com.android.systemui] **
Pss Private Private SwapPss Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 106880 106780 0 73228 196200 182430 13769
Dalvik Heap 35655 35636 0 217 40741 20371 20370
Dalvik Other 3347 3344 0 112
Stack 56 56 0 16
Ashmem 4 0 0 0
Other dev 18 0 16 0
.so mmap 2998 164 352 499
.jar mmap 669 0 248 0
.apk mmap 17904 0 13620 0
.ttf mmap 372 0 180 0
.dex mmap 10041 16 10020 20
.oat mmap 3848 0 84 0
.art mmap 1641 1364 0 123
Other mmap 64 12 24 0
EGL mtrack 106434 106434 0 0
GL mtrack 55564 55564 0 0
Unknown 1952 1948 0 1565
TOTAL 423227 311318 24544 75780 236941 202801 34139
For iOS, my currently limited toolchain doesn't help much. You may have luck using Instruments, for which you can find here a command-line reference, but I haven't tried that: https://help.apple.com/instruments/mac/current/#/devb14ffaa5

Fuel Consumption and mileage from OBD2 port parameters.

I am computing my fuel consumption from OBD2 parameter. MAF to be specific and I am receiving data on per second basis. Here is an section of my data.
TS RS EngS MAF R MAP EL TD Travel
14:41:22 31 932 1056 98 23978 12130
14:41:23 29 2084 2639 107 23210 12130
14:41:24 32 2154 3867 149 38826 12130
14:41:25 36 2426 4683 184 36266 12130
14:41:26 39 2391 3031 133 682 12130
14:41:27 40 1784 2794 132 30634 12130
14:41:28 42 1864 2853 140 30378 12130
14:41:29 43 1953 2900 132 29098 12130
14:41:30 46 2031 3017 135 29098 12130
14:41:31 45 2027 2969 126 20138 12130
14:41:32 47 2122 4253 174 42154 12130
14:41:33 51 2220 4722 183 20906 12130
Where
TS : Time Stamp,
RS : Road Speed,
EngS : Engine Speed,
MAF R : Mass Air Flow Rate,
MAP Mass Air Pressure,
EL : Engine Load,
TD Travel : Total Distance Traveled
So basically from this data I am trying to compute my Instantaneous Fuel Consumption and The Mileage in KMPL.
For that, Since The Data is per second i am taking MAF of each row and using this formula,
Fuel Consumption = MAF/(14.7*710),
where 14.7 = ideal air/fuel ratio,
and 710 is density of gasoline in grams/L
So, this should give my consumption. and I am calculating the distance(in KM) from RS /3600. And further dividing distance by fuel consumption to get mileage. However the calculation is coming horribly wrong. The mileage of my car is around 14KMPL. Here are my results.
TS Distance (inKM) Fuel Consum(L) Mileage(KMPL)
14:41:22 0.0086111111 0.1008355216 0.0853975957
14:41:23 0.0080555556 0.2519933158 0.0319673382
14:41:24 0.0088888889 0.369252805 0.0240726374
14:41:25 0.01 0.4471711626 0.0223628016
14:41:26 0.0108333333 0.2894246837 0.0374305785
14:41:27 0.0111111111 0.2667939842 0.0416467828
14:41:28 0.0116666667 0.2724277871 0.0428248043
14:41:29 0.0119444444 0.2769157317 0.0431338602
14:41:30 0.0127777778 0.2880878491 0.0443537546
14:41:31 0.0125 0.2835044163 0.0440910239
14:41:32 0.0130555556 0.4061112437 0.0321477323
14:41:33 0.0141666667 0.4508952017 0.0314189785
Can someone tell what am I doing so wrong that the computation is so wrong. As the formulas are simple there isn't much scope to do error.Thank You.
MAF is in g/s
MAF(g/s) * 1/14.7 * 1L/710g = Fuel Consumption in L/s Units
Speed (V) is in KPH (Km/hr) so V(Km/hr) * (1hr/3600s) = v KPS(Km/s)
so FC(L/s) / v (Km/s) = L/Km
you want Km/L so v/Fc so your final formula is
KmPL = V * 1/ 3600 * 1/MAF * 14.7 * 710
Divide the MAF by 14.7 to get Grams of fuel per Sec
next divide by 454 to get lbs fuel/sec
next divide 6.701 to get fuel/sec
multiply by 3600 to get gallons/ hr
other case GPH=MAF*0.0805 next MPG=MPH?GPH

Memory Leak in Unknown Field from meminfo

I am loosing about 18k every five minutes in the Unknown Field. Any ideas what this could be and how to debug it?
Thanks!
Applications Memory Usage (kB):
Uptime: 444373583 Realtime: 444373583
** MEMINFO in pid 4758 [org.domain.activity] **
Pss Private Private Swapped Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 0 0 0 0 13492 12878 613
Dalvik Heap 6983 6912 0 0 8932 7183 1749
Dalvik Other 1761 1620 0 0
Stack 192 192 0 0
Ashmem 7 0 0 0
Other dev 192 188 4 0
.so mmap 2996 2284 88 0
.apk mmap 53 0 12 0
.ttf mmap 7 0 0 0
.dex mmap 896 8 544 0
Other mmap 7 4 0 0
Unknown 12018 11992 0 0
TOTAL 25112 23200 648 0 22424 20061 2362
Objects
Views: 26 ViewRootImpl: 1
AppContexts: 3 Activities: 1
Assets: 3 AssetManagers: 3
Local Binders: 7 Proxy Binders: 16
Death Recipients: 0
OpenSSL Sockets: 0
SQL
MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/data/app/org.domain.activity.apk:/assets/DS-DIGIB.TTF: 24K

How to line up columns of a pivot table

I have a pivot table that is being created like this:
date Services Uptime Services Downtime Centers Downtime Centers Uptime
----- --------- - ------------------ ---------------- ---------------
12/5/14 100.00% 0.00% 100.00% 100.00%
12/12/14 100.00% 0.00% 0.00% 0.00%
12/19/14 100.00% 0.00% 100.00% 0.00%
12/26/14 100.00% 0.00% 100.00% 0.00%
I would like it to come out as a pivot table, like this:
Date Name Uptime Downtime
----- ------ --------- -------------
12/5/14 Services 100.00% 0.00%
12/5/14 Center 100.00% 100.00%
12/12/14 services 100.00% 0.00%
12/12/14 Center 0.00% 0.00%
If you only have those 2 values, try a UNION:
select [date]
,'Services'
,[Services Uptime] as Uptime
,[Services Dowtime] as Downtime
from myTable
union all
select [date]
,'Center'
,[Centers Uptime] as Uptime
,[Centers Dowtime] as Downtime
from myTable
Edited: to include Jason suggestion about "union all"
May be you need to unpivot instead of pivoting. I will do this using cross apply with tables valued constructor.
Performance wise this will be better than Union All if you have some more names
SELECT [date],NAME, uptime, downtime
FROM Yourtable
CROSS apply (VALUES ('service',Services_Uptime,Services_Downtime),
('center',Centers_Uptime,Centers_Downtime) )
cs (NAME, uptime, downtime)