由买买提看人间百态

topics

全部话题 - 话题: heap
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
c*****w
发帖数: 50
1
数组heap-sort,存储在数组中的heap ordered tree 不按level order而按pre order
如何实现? Thanks!
y***y
发帖数: 295
2
来自主题: Programming版 - OutofMemoryError: Java Heap Space
【 以下文字转载自 Java 讨论区 】
发信人: ylyly (转回原点), 信区: Java
标 题: OutofMemoryError: Java Heap Space
发信站: BBS 未名空间站 (Mon Aug 4 22:34:24 2008), 转信
java里面大家遇到这种问题怎么解决?
程序跑起来需要的heap空间比较大
都用了Xmx1440m了还出这种错误:(
我不明白为什么这个时候virtual memory不能起作用呢?
q*******i
发帖数: 353
3
来自主题: Programming版 - java heap space out 问题 (转载)
【 以下文字转载自 Java 讨论区 】
发信人: qqwuweiyi (娓娓), 信区: Java
标 题: java heap space out 问题
发信站: BBS 未名空间站 (Fri May 14 23:50:54 2010, 美东)
每次运行都提示Java:out of memory : heap space
这个问题怎么解决?谢谢
o****i
发帖数: 1706
4
【 以下文字转载自 Linux 讨论区 】
发信人: ouyadi (可乐会捂帮帮众), 信区: Linux
标 题: Valgrind报uninitialized value was created by a heap allocation
发信站: BBS 未名空间站 (Sat Feb 19 12:11:20 2011, 美东)
程序运行正常,可是在测memery leak的时候报上面那个错,具体错误消息如下:
==25663== Conditional jump or move depends on uninitialised value(s)
==25663== at 0x400C9F: add_edge (graph.c:59)
==25663== by 0x40071A: main (main.c:13)
==25663== Uninitialised value was created by a heap allocation
==25663== at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==256... 阅读全帖
f**e
发帖数: 115
5
来自主题: Programming版 - Heap corruption (转载)
【 以下文字转载自 Software 讨论区 】
发信人: fage (fage), 信区: Software
标 题: Heap corruption
发信站: BBS 未名空间站 (Mon Oct 17 03:12:47 2011, 美东)
C++,运行时Free的时候发生Heap corruption错误。
怎么Debug?
谢谢!!!
g***l
发帖数: 2753
6
帮人查一个js程序的memory leak问题,在触发garbage collector之前,有没有
办法知道这个js程序中的所有objects在heap中的状态。
比如我能不能加入一段代码去拿到当前用了多少M的heap? Does this depend on the
browser?
谢谢
c****f
发帖数: 1102
7
memory managment heap唯一有关的javau应该就是gc了 不过这不是就一句话吗。。而
且heap唯一的结构不就是随意堆放 从后往前嘛
y***n
发帖数: 912
8
来自主题: Security版 - HELP! 中了bo:heap virus, IE 动辄就死
中了bo:heap virus. 我用的是McAfee VirusScan Enterprise 8.0, IE 7.0 version.
IE用不了多会儿就死,常显示的信息是:
Message: VirusScan Alert!
Pathway: C:Program Files\Internet Explorer\ieexplorer.exe::VirtualProtect
Detected as: bo:heap
State: Blocked by buffer overflow protection
也有时就显示IE需关闭。相当郁闷。
恳请高人出手相助。多谢。
m***o
发帖数: 1367
9
来自主题: Unix版 - heap fragmentation under Solaris 2.x
Does anyone know a good way to guess/tell/estimate heap fragmentation under
Solaris 2.x?
My app is slowly running out of memory, although the memory increasing rate
went down with time after several days. So I am not sure it is caused by some
small leak or heap fragmentation.
Thanks.
l********y
发帖数: 185
10
最近在选miniVan和三排座SUV,一些candidates的参数汇总,希望对大家有所帮助。
(注:按照miniVan,大SUV,中SUV分类,每类按照Leg Room降序排列)
Year Model 3rd-Row 3rd-Row Cargo Volume Curb weight
Leg Room Heap Room with 3rd-Row Up (lbs)
(in) (in) (ft3)
2014 Odyssey 42.4 48.4 38.4 4396
2014 Quest 40.5 49.6 25.7 4387
2014 Sienna 36.3 50.3 39.1 4415
2014 Town&Country 32.7 48.7 ... 阅读全帖
l**********r
发帖数: 4612
11
suppose char x[] is defined at global scope.
I think x[] is on heap with 4 bytes memory. Compiler allocated the space and
copied "abc" on the space
s****g
发帖数: 56
12
4 bytes at least. There is a '\0'.
I think heap memory is allocated with malloc.
Otherwise on stack or somewhere else.
Probably x is on stack (it is a pointer) and "abc" is on
global constant area. Not 100% sure.

space and
l**********r
发帖数: 4612
13
Hmmmm. what I mean is for
Char x[] = "abc"
the "abc" that x points to is on *heap*
y*****a
发帖数: 171
14
how could it be in the heap, you never call alloc for this, do you. it is
done by the compiler. you got it clear?
l.c
char *x1="abc1";
char x2[]="abc2";
gcc -s -c l.c
cat l.s
.file "l.c"
.globl x1
.section .rodata
.LC0:
.string "abc1"
.data
.align 4
.type x1, @object
.size x1, 4
x1:
.long .LC0
.globl x2
.type x2, @object
.size x2, 5
x2:
.string "abc2"
.ident "GCC: (GNU) 4.1.2 2008
S**Y
发帖数: 136
15
the "level order traversal" of a heap is the order of the array inside the h
eap. Of course you can copy the array...
C**********n
发帖数: 100
16
what do you mean the order of the array inside the heap?

h
S**Y
发帖数: 136
17
normally heap is implemented by an array..
c*****o
发帖数: 178
18
来自主题: JobHunting版 - 一道 JAVA Stack vs Heap 题 (转载)
在heap上。s1,s2是指向同一个address。都是指向常量"grapefruit"
s3也是指向"grapefruit",因为在编译阶段"grape"和"fruit"被连接起来,所以还是指
向同一个常量。
s4和s5指向不同的地址,因为new创建了2个不同的对象,尽管内容相同。
最后一个问题我认为是第一个快一些,不确定。
c***y
发帖数: 560
19
来自主题: JobHunting版 - A problem about Heap and Stack.
how to enforce an object instance only be allocated on the stack rather than
the heap at compile time?
thanks a lot.
B*****t
发帖数: 335
20
来自主题: JobHunting版 - A problem about Heap and Stack.
There are 3 memory storage types for c++ to allocate memory for an object.
1. stack memory for object inside a function.
2. static storage for namespace-scope objects and local static objects
3. heap storage for dynamically-allocated objects.
If the stack in you problem refers to the first type of memory storage,
there is only one method that you could do this, which is defining a
function, allocating memory for an object inside a function, and using it.
You cannot use it outside of a function.
f****4
发帖数: 1359
21
来自主题: JobHunting版 - A problem about Heap and Stack.
effective c++ & more effective c++上有讨论
如果禁止一个对象在stack上生成;把析构函数声明成私有函数
如果只想在heap上生成;构造函数声明成私有;同时提供虚拟构造函数(这里不是指
virtual constructor,而是指用factory patterns生成对象)
a****l
发帖数: 245
22
来自主题: JobHunting版 - A problem about Heap and Stack.
To prohibit heap-based objects, we can declare operator new (and operator
delete) as private since it is called by the new operator.
s********a
发帖数: 1447
23
来自主题: JobHunting版 - 请问一下啥是static/dynamic heap?
heap不都是用malloc等分配的嘛
怎么还基于数组或者树呢?
y**i
发帖数: 1112
24
来自主题: JobHunting版 - 请问一下啥是static/dynamic heap?
heap数据结构不是用数组实现的么?在这种情况下,不是数组和树有个对应关系么?
H*X
发帖数: 281
25
来自主题: JobHunting版 - 请问一下啥是static/dynamic heap?

我觉得是在问程序在内存里空间的占用吧
static heap或许是指static variables declared inside a function
然后dynamic 指普通malloc来的空间吧
y**i
发帖数: 1112
26
来自主题: JobHunting版 - 请问一下啥是static/dynamic heap?
我也不知道楼主的问题指的是什么,不过且不说这个,static变量不是被分配在全局区
/静态区么,heap区不是说是需要程序员自己释放空间,全局区会在程序结束时自动释
放么
z****e
发帖数: 2024
27
来自主题: JobHunting版 - [C++]请问哪些变量在heap创建?
你说得这些都不在heap上面
t**g
发帖数: 1164
28
来自主题: JobHunting版 - [C++]请问哪些变量在heap创建?
你是说只有new出来的才会在heap里,其余的全在stack?
j*t
发帖数: 184
29
来自主题: JobHunting版 - [C++]请问哪些变量在heap创建?
有些基本原则。一般dynamic的在heap,static的在stack.有一些是compiler based.
i**********b
发帖数: 77
30
来自主题: JobHunting版 - 避免compile-time从heap申请空间
在global 空间用 new
请问,这样new申请的空间是在compile-time完成的还是run-time完成的?
怎么避免compile-time从heap申请空间呢?
谢谢
i**********b
发帖数: 77
31
来自主题: JobHunting版 - 避免compile-time从heap申请空间
没人会啊?
我的理解是只要是 new 出来的,就都在heap上,都是run-time才做的。
a*****k
发帖数: 704
32
来自主题: JobHunting版 - heap 和 stock都有些啥区别啊?
heap and stack?
h**6
发帖数: 4160
33
来自主题: JobHunting版 - heap 和 stock都有些啥区别啊?
拿到offer之后,对方通常只会给stock,不给heap。
z*z
发帖数: 837
34
来自主题: JobHunting版 - heap 和 stock都有些啥区别啊?
大家都不厚道呀。
这里有个很不错的解释:
http://www.maxi-pedia.com/what+is+heap+and+stack
M**********n
发帖数: 432
35
来自主题: JobHunting版 - heap 和 stock都有些啥区别啊?
Local variables and function parameters are stored in stack. These variables
disappear upon exit.
Dynamically allocated memories (malloc) and objects (new) are stored in heap
. These exist through the whole program unless you explicitly remove them,
or by garbage collector (in java).
I am not an expert though.
f*z
发帖数: 34
36
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
careercup上看到的,没有想到好的办法。
题目:
Convert a min heap to BST without changing its structure and
of course no extra space
S******n
发帖数: 1009
37
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
min heap->linkedlist->BST

structure and
f*z
发帖数: 34
38
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
你的意思是这个heap是链接起来的,而不是通常的用一个array表示的?
f*z
发帖数: 34
39
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
我觉得意思是heap跟BST都是binary tree, 保持structure只是保持树形,里面的内容
当然移动了。
f*z
发帖数: 34
40
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
这个链接是二叉树的链接法,就是node有left child, right child, parent指针。
所以operation仍然是O(logN).
对于用array表示的heap和BST, 怎么样来转换呢?
v*******7
发帖数: 187
41
来自主题: JobHunting版 - 算法题:min heap inplace变 BST

Sorry,呵呵,刚明白过来,要是用array表示的heap,那做起来更简单,因为不需要用
到parent
指针了,其他都一样,那么time complexity还是O(nlgn),也是inplace的。
t****0
发帖数: 235
42
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
do you have to call
getMin n times to get the linked list?
that is nlgn
I think it does not matter if pointer or array is used to represent the
heap right?
t****0
发帖数: 235
43
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
this is more like
heap -> sorted array -> bst
b*******s
发帖数: 5216
44
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
heap sorting O(nlogn)
然后就可以说这是BST了
root是n/2的点
左child是 n/4 ,右child是3n/4
一路二分下去
仅仅是各层节点没有按顺序存放而已
f*******4
发帖数: 1401
45
来自主题: JobHunting版 - 算法题:min heap inplace变 BST
heap sort需要额外空间吧?
H******7
发帖数: 1728
46
c++中,对象的实例都被分配在HEAP里 这个概念对么?
s*********u
发帖数: 517
47
不一定,只有当用pointer的时候,object instance才在heap里。
p*****s
发帖数: 4393
48
c++ 里,variable在哪,实例就在哪。
java里面,primitive type在variable里,reference type的variable从stack指到
heap的实例
隐约记得是这样。 谁来确定确定
M7
发帖数: 219
49
我觉得你说的java是对的。
C++里面new出来的对象都是在heap里。其他都在stack里。是不是这样?
f*******y
发帖数: 1148
50
感觉你是对的
primitive type的变量存在stack里
reference type的variable名存在stack里,其内容也就是reference指向的instance存
在heap里
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)