Should my Conky be using up 0.50% (nearly 20MB) of Memory?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There's also a slight leakage in the lua clock, i have noted over a period of several hours, the memory usage increases to nearly 2%.
Code:
--[[
Air Clock by Alison Pitt (2009)
This clock is designed to look like KDE 4.3's "Air" clock, but from inside Conky.
You can adjust the clock's radius and placement, as well as the size and offset of the drop shadow. You can also choose whether to display the seconds hand. This clock updates every time Conky does, so if you want to show seconds, it is recommended that you set update_interval to no more than 0.5s. If you turn off seconds, you can set the update_interval to as long as 30s. The settings are in the "Settings" section, starting at Line 21.
Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/clock.lua):
lua_load ~/scripts/clock.lua
lua_draw_hook_pre draw_clock
]]
require 'cairo'
function conky_draw_clock()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
-- Settings
-- What radius should the clock face (not including border) be, in pixels?
local clock_r=36
-- x and y coordinates, relative to the top left corner of Conky, in pixels
local xc=315
local yc=114
-- Extent of the shadow, in pixels
shadow_width=5
-- x and y offsets of the drop shadow, relative to the centre of the clock face, in pixels. Can be positive (downward) or negative (upward)
shadow_xoffset=0
shadow_yoffset=2
-- Do you want to show the second hand? Use this if you use a Conky update_interval > 1s. Can be true or false.
show_seconds=false
-- Grab time
local hours=os.date("%I")
local mins=os.date("%M")
local secs=os.date("%S")
secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins
hours_arc=(2*math.pi/12)*hours+mins_arc/12
-- Drop shadow
local ds_pat=cairo_pattern_create_radial(xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25,xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25+shadow_width)
cairo_pattern_add_color_stop_rgba(ds_pat,0,0,0,0,0.2)
cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,0)
cairo_move_to(cr,0,0)
cairo_line_to(cr,w,0)
cairo_line_to(cr,w,h)
cairo_line_to(cr,0,h)
cairo_new_sub_path(cr)
cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
cairo_set_source(cr,ds_pat)
cairo_set_fill_rule(cr,CAIRO_FILL_RULE_EVEN_ODD)
cairo_fill(cr)
-- Glassy border
cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
cairo_set_line_width(cr,1)
cairo_stroke(cr)
local border_pat=cairo_pattern_create_linear(xc,yc-clock_r*1.25,xc,yc+clock_r*1.25)
cairo_pattern_add_color_stop_rgba(border_pat,0,1,1,1,0.7)
cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,1,1,1,1,0.7)
cairo_set_source(cr,border_pat)
cairo_arc(cr,xc,yc,clock_r*1.125,0,2*math.pi)
cairo_close_path(cr)
cairo_set_line_width(cr,clock_r*0.25)
cairo_stroke(cr)
-- Set clock face
cairo_arc(cr,xc,yc,clock_r,0,2*math.pi)
cairo_close_path(cr)
local face_pat=cairo_pattern_create_radial(xc,yc-clock_r*0.75,0,xc,yc,clock_r)
cairo_pattern_add_color_stop_rgba(face_pat,0,1,1,1,0.9)
cairo_pattern_add_color_stop_rgba(face_pat,0.5,1,1,1,0.9)
cairo_pattern_add_color_stop_rgba(face_pat,1,0.9,0.9,0.9,0.9)
cairo_set_source(cr,face_pat)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
cairo_set_line_width(cr, 1)
cairo_stroke (cr)
-- Draw hour hand
xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,0,0,0,0.5)
cairo_stroke(cr)
-- Draw minute hand
xm=xc+0.9*clock_r*math.sin(mins_arc)
ym=yc-0.9*clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)
cairo_set_line_width(cr,3)
cairo_stroke(cr)
-- Draw seconds hand
if show_seconds then
xs=xc+0.9*clock_r*math.sin(secs_arc)
ys=yc-0.9*clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)
cairo_set_line_width(cr,1)
cairo_stroke(cr)
cairo_destroy(cr)
cairo_surface_destroy(c)
end
end
Would appreciate any suggestions, even a "don't worry, that's quite normal" from a Conky expert would set my mind at ease.
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Original Poster
Rep:
I did that, doesn't make any difference, the leakage over a period of time caused by it stops but usage never goes below 0.49%. Did the same with the Daylight-info execi line, same thing.
It could be the new kernel. It's hard to say.
I asked a friend of mine who's still into conky if he's aware of any issues with conky 1.10.0 on kernel 3.16.x vs 4.1.x
I should have an answer "tomorrow".
He's in another hemisphere, literally.
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Original Poster
Rep:
Thanks, means a lot, you taking the trouble. Thought i'd try out gkrellm and see how it compared..it's even worse, memory usage is 0.57% with no Built-ins but just the hostname and the gkrellmoon plugin enabled. I am certainly better off with Conky even if it's not optimal yet.
My conky rules are pretty light compared to those you posted as well.
I would consider my ~10MB on 32 bit machine comparable to your ~20MB on 64 bit machine, but would not consider either to be unusual by current software standards (or lack thereof).
Is it causing you problems or are you just surprised at the memory footprint?
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Original Poster
Rep:
Quote:
Originally Posted by astrogeek
...My conky rules are pretty light compared to those you posted as well.
How do mean, lighter? I was under the impression that i'd the bare minimum that was required for a proper Hardware Monitor..apart from the lua-clock which is the only thing of beauty in it
Quote:
I would consider my ~10MB on 32 bit machine comparable to your ~20MB on 64 bit machine, but would not consider either to be unusual by current software standards (or lack thereof).
That's somewhat comforting
Quote:
Is it causing you problems or are you just surprised at the memory footprint?
Nope, no problems, i am just persnickety about system resource usage on my Debian partition as i have gone to a lot of trouble trying to make it as lean as i could. For luxury i use my LMDE partition.
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Original Poster
Rep:
That's a pretty neat looking conky, and you even have several graphs running! But i need to keep an eye on those individual core temps. and how they fluctuate with usage, even if those readings are the problem. I will certainly try to trim some redundant bits from the configuration settings like shades, graphs, color etc along the lines of yours though and see if that makes a difference. Remember reading somewhere that keeping the alignment "bottom_right" also helps. Will try it out. Thanks for the code.
Btw, it's only the clock which uses cairo and as i said, deleting those lines does not decrease the memory usage, only prevents the slow leakage, ie. now after a little over 5 hrs. of Uptime, it has gone up from 0.49% to 0.69%. I created a kill switch in my openbox root menu just for that.
Edit: Learned something new about the "$image" variable. There's this Debian swirl i'd downloaded, it's a 1028x1270 pixel image. Wanted to display it as an icon in the top left corner of my Conky. First i tried ${image /image_path -s 36x45}. The memory immediately jumped to 0.66%. So i scaled it down with Gimp and used it without the scaling operator, and guess what, the memory usage dropped down to 0.54%. How inefficient is the scaling operation in Conky, eh? Still, even without it, this pre-scaled icon meant an increase of 0.05% (from 0.49% earlier), that's as much memory as my elaborate lua clock uses, with cairo and all!
Well, it's not good news, nor bad news (well it is, for him).
My contact says only he has the 3.16 kernel only using conky 1.9 only.
And he has 2000 conkys to 'update'. Yikes.
wrt 1.10.x and LUA: "some elements that aren't working from what I've read" is all he said.
I wish I had more to tell you, but I don't.
Sorry about that.
It's been my experience that conky does cost resources to monitor resources.
Image the overhead on this
I never thought twice about it on my 2g of RAM system.
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Original Poster
Rep:
Thanks for trying, it only remains for me to take mine apart one object variable at a time and see which ones are the most costly, already found that about <$image>.
As to that Conky image, WOW! Now that's enthusiasm, that's dedication, that's art, what's a few hundred measly MBs for something like that.
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
own_window_colour black
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
use_xft yes
xftfont Sans Bold
uppercase no # set to yes if you want all text to be in uppercase
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 24
gap_y 24
# stuff after 'TEXT' will be formatted on screen
TEXT
${color }$nodename ${hr}
${color #9fb6cd}Kernel:$alignr${color }$kernel
${color #9fb6cd}UpTime: $alignr${color }$uptime
${cpugraph 20,200 000000 ffffff}
${color #9fb6cd}Load: $alignr${color }$loadavg
#${color #9fb6cd}Processes: $alignr${color }$processes
#${color #9fb6cd}Running: $alignr${color }$running_processes
${color #9fb6cd}Highest CPU:
${color #ddaa00} ${top name 1}$alignr${top_mem cpu 1}
#${color lightgrey} ${top name 2}$alignr${top cpu 2}
${color lightgrey} ${top name 3}$alignr${top cpu 3}
#${color lightgrey} ${top name 4}$alignr${top cpu 4}
#${color lightgrey} ${top name 5}$alignr${top cpu 5}
Ram : $mem - $memmax - $memperc
Swap: $swap $swapmax ${swapbar 7,89}
${color #9fb6cd}Highest MEM:
${color #ddaa00} ${top_mem name 1}$alignr${top_mem mem 1}
#${color lightgrey} ${top_mem name 2}$alignr${top_mem mem 2}
#${color lightgrey} ${top_mem name 3}$alignr${top_mem mem 3}
#${color lightgrey} ${top_mem name 4}$alignr${top_mem mem 4}
#${color lightgrey} ${top_mem name 5}$alignr${top_mem mem 5}
#${color #9fb6cd}CPU TEMP:$alignr${color}${hddtemp /dev/sda}
#${color #9fb6cd}MEM: $alignr${color } $memperc% $mem/$memmax
${membar 3,100}
${color #9fb6cd}ROOT: $alignr${color }${fs_free /}/${fs_size /}
${fs_bar 3,100 /}
${color #9fb6cd}HOME: $alignr${color }${fs_free /home}/${fs_size /home}
${fs_bar 3,100 /home}
${color #9fb6cd}STUFF: $alignr${color }${fs_free /media/harry/_stuff}/${fs_size /media/harry/_stuff}
${fs_bar 3,100 /media/harry/_stuff}
#${color white}link strength: ${color white} ${wireless_link_bar 7,50 wlan0}
${color #9fb6cd}${time %a, } $alignr${color }${time %e %B %G}
${color #9fb6cd}${time %Z, }$alignr${color }${time %H:%M:%S}
#Tempurature: $alignr${hwmon 1 temp 1}° C
Tempurature CPU: $alignr${acpitemp}° C
Weather: ${execi 300 /home/harry/weather 79772}
It is a single cpu amd box in the Motorcycle shop office for customers to play with while waiting.
On my AntiX laptops and netbooks with 4.3 kernels. No problems with conky on those. Here is my pastebin account with certain saved conkyrc of mine.
You are welcome to them http://pastebin.com/u/rokytnji
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.