Displaying 15 results from an estimated 15 matches for "object_size".
2012 Feb 24
1
function remains loaded in the search space after detaching the package
I ran into some very irritating behaviour I don't understand. Let me
illustrate with the package gdata() and the function
print.object_size() :
> print(object.size(iris),units='Kb')
6.3 Kb
> getAnywhere(print.object_size)
A single object matching ?print.object_size? was found
It was found in the following places
registered S3 method for print from namespace utils
namespace:utils
with value
...
All is well. So now I...
2014 Sep 07
0
format(object.size(...), units): KB, MB, and GB instead of Kb, Mb, and Gb?
...has already been discussed or not, and I'm a
bit worried I'm throwing off an endless debate. If it's already
settled, no need to discuss it further.
TOPIC #1:
Shouldn't R use KB, MB and GB when reporting on sizes kilobytes,
megabytes and gigabytes? More specifically, format() for object_size
objects (returned by object.size()) uses Kb, Mb and Gb, which AFAIK is
more often used to indicate sizes in kilobits, megabits and gigabits,
e.g.
> format(structure(2e3, class="object_size"), units="auto")
[1] "2 Kb"
> format(structure(2e6, class="object_si...
2015 Sep 29
3
making object.size() more meaningful on environments?
Hi,
Currently object.size() is not very useful on environments as it always
returns 56 bytes, no matter how big the environment is:
env1 <- new.env()
object.size(env1) # 56 bytes
env2 <- new.env(hash=TRUE, size=75000000L)
object.size(env2) # 56 bytes
env3 <- list2env(list(a=runif(25000000), L=LETTERS))
object.size(env3) # 56 bytes
This makes it pretty useless on
2010 Jul 25
1
Discrepancy in help for object.size() and question on how to round object sizes
I think there is a discrepancy In the help for object.size().
In the usage section there is the comment:
## S3 method for class 'object_size':
while in the value section there is the text:
An object of class ?"object.size"? ...
And R itself says:
> class(object.size(letters))
[1] "object_size"
Also, I was trying to print out object sizes in Kb, but rounded to
whole number of units, but I could not
figure...
2020 Mar 27
2
object.size vs lobstr::obj_size
...,232 B
> lobstr::obj_sizes(A, new("A", stuff=raw(0)))
> #> * 719,232 B
> #> * ? ? 720 B
> lobstr::obj_sizes(A, new("A", stuff=runif(1e8)))
> #> * ? ? 719,232 B
> #> * 800,000,720 B
Nice. Can you clarify the situation with lobstr::obj_size vs
pryr::object_size? I've heard of the latter before and use it sometimes
but never heard of the former before seeing Stefan's post. Then I
checked the authors of both and thought maybe they should talk to each
other ;-)
Thanks,
H.
>
> Hadley
> --
> http://hadley.nz
> <https://urldefe...
2017 Nov 22
2
function pointers?
We have a project that calls for the creation of a list of many
distribution objects. Distributions can be of various types, with
various parameters, but we ran into some problems. I started testing
on a simple list of rnorm-based objects.
I was a little surprised at the RAM storage requirements, here's an example:
N <- 10000
closureList <- vector("list", N)
nsize = sample(x
2020 Mar 27
1
object.size vs lobstr::obj_size
...> #> * 719,232 B
> > #> * ? ? 720 B
> > lobstr::obj_sizes(A, new("A", stuff=runif(1e8)))
> > #> * ? ? 719,232 B
> > #> * 800,000,720 B
>
> Nice. Can you clarify the situation with lobstr::obj_size vs
> pryr::object_size? I've heard of the latter before and use it sometimes
> but never heard of the former before seeing Stefan's post. Then I
> checked the authors of both and thought maybe they should talk to each
> other ;-)
>
>
> pryr is basically retired :) TBH I don't k...
2013 Jan 16
6
[PATCH V2] mm/slab: add a leak decoder callback
...ent */
int reserved; /* Reserved bytes at the end of slabs */
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 3f3cd97..8c19bfd 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -193,6 +193,7 @@ kmem_cache_create_memcg(struct mem_cgroup *memcg, const char *name, size_t size,
s->object_size = s->size = size;
s->align = calculate_alignment(flags, align, size);
s->ctor = ctor;
+ s->decoder = NULL;
if (memcg_register_cache(memcg, s, parent_cache)) {
kmem_cache_free(kmem_cache, s);
@@ -248,7 +249,7 @@ kmem_cache_create(const char *name, size_t size, size_t alig...
2020 Mar 27
0
object.size vs lobstr::obj_size
...quot;A", stuff=raw(0)))
> > #> * 719,232 B
> > #> * 720 B
> > lobstr::obj_sizes(A, new("A", stuff=runif(1e8)))
> > #> * 719,232 B
> > #> * 800,000,720 B
>
> Nice. Can you clarify the situation with lobstr::obj_size vs
> pryr::object_size? I've heard of the latter before and use it sometimes
> but never heard of the former before seeing Stefan's post. Then I
> checked the authors of both and thought maybe they should talk to each
> other ;-)
>
pryr is basically retired :) TBH I don't know why I gave up on it...
2013 Jan 14
5
[PATCH] mm/slab: add a leak decoder callback
...ent */
int reserved; /* Reserved bytes at the end of slabs */
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 3f3cd97..39a0fb2 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -193,6 +193,7 @@ kmem_cache_create_memcg(struct mem_cgroup *memcg, const char *name, size_t size,
s->object_size = s->size = size;
s->align = calculate_alignment(flags, align, size);
s->ctor = ctor;
+ s->decoder = NULL;
if (memcg_register_cache(memcg, s, parent_cache)) {
kmem_cache_free(kmem_cache, s);
diff --git a/mm/slub.c b/mm/slub.c
index ba2ca53..0496a2b 100644
--- a/mm/slub.c...
2020 Mar 27
4
object.size vs lobstr::obj_size
Hi Tomas,
On 3/27/20 07:01, Tomas Kalibera wrote:
> they provide an over-approximation
They can also provide an "under-approximation" (to say the least) e.g.
on reference objects where the entire substance of the object is ignored
which makes object.size() completely meaningless in that case:
setRefClass("A", fields=c(stuff="ANY"))
2012 Nov 15
3
Likely mem leak in 3.7
Starting with 3.7 rc1, my workstation seems to loose ram.
Up until (and including) 3.6, used-(buffers+cached) was roughly the same
as sum(rss) (taking shared into account). Now there is an approx 6G gap.
When the box first starts, it is clearly less swappy than with <= 3.6; I
can''t tell whether that is related. The reduced swappiness persists.
It seems to get worse when I update
2019 Jan 15
4
Objectsize function visiting every element for alt-rep strings
I have a toy alt-rep string package that generates randomly seeded strings.
example:
library(altstringisode)
x <- altrandomStrings(1e8)
head(x)
[1] "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc
object.size(1e8)
Object.size will call the set_altstring_Elt_method for every single
element, materializing (slowly) every element of the vector. This
2009 Apr 17
0
R 2.9.0 is released
...format.POSIXLt.
o body<-() now treats list values consistently with other
types: they no longer need to be wrapped in a list() call.
o option("pdfbrowser") is now set on Windows as well as on
Unix-alikes.
o object.size() now returns an object of class "object_size" and
has a print() method.
o [col/row]Sums(), *Means() now have an additional '...' argument,
so that they can more easily be turned into generic functions.
o Package 'tools' contains dependsOnPkgs() to compute reverse
dependencies.
o...
2009 Apr 17
0
R 2.9.0 is released
...format.POSIXLt.
o body<-() now treats list values consistently with other
types: they no longer need to be wrapped in a list() call.
o option("pdfbrowser") is now set on Windows as well as on
Unix-alikes.
o object.size() now returns an object of class "object_size" and
has a print() method.
o [col/row]Sums(), *Means() now have an additional '...' argument,
so that they can more easily be turned into generic functions.
o Package 'tools' contains dependsOnPkgs() to compute reverse
dependencies.
o...