Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
20547a9f
Commit
20547a9f
authored
6 years ago
by
Vitaliy.Bibaev
Browse files
Options
Download
Email Patches
Plain Diff
[memory-agent] Do not estimate the retained size of too many objects (more than 2000)
parent
21b7e250
Branches unavailable
Tags unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java
+5
-0
...c/com/intellij/debugger/memory/agent/MemoryAgentUtil.java
with
5 additions
and
0 deletions
+5
-0
java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java
+
5
-
0
View file @
20547a9f
...
...
@@ -36,6 +36,7 @@ import java.util.jar.Attributes;
public
class
MemoryAgentUtil
{
private
static
final
Logger
LOG
=
Logger
.
getInstance
(
MemoryAgentUtil
.
class
);
private
static
final
int
ESTIMATE_OBJECTS_SIZE_LIMIT
=
2000
;
public
static
void
addMemoryAgent
(
@NotNull
JavaParameters
parameters
)
{
if
(!
DebuggerSettings
.
getInstance
().
ENABLE_MEMORY_AGENT
)
{
...
...
@@ -83,6 +84,10 @@ public class MemoryAgentUtil {
public
static
List
<
JavaReferenceInfo
>
tryCalculateSizes
(
@NotNull
List
<
JavaReferenceInfo
>
objects
,
@Nullable
MemoryAgent
agent
)
{
if
(
agent
==
null
||
!
agent
.
canEvaluateObjectsSizes
())
return
objects
;
if
(
objects
.
size
()
>
ESTIMATE_OBJECTS_SIZE_LIMIT
)
{
LOG
.
info
(
"Too many objects to estimate their sizess"
);
return
objects
;
}
try
{
long
[]
sizes
=
agent
.
evaluateObjectsSizes
(
ContainerUtil
.
map
(
objects
,
x
->
x
.
getObjectReference
()));
return
IntStreamEx
.
range
(
0
,
objects
.
size
())
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help