yunus emre güney

Greenhorn
+ Follow
since Feb 23, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yunus emre güney

I have a long-running JVM Spring server application that undergoes continuous processing. I've noticed a gradual increase in memory usage over time, but it never leads to a JVM out-of-memory crash. However, when I manually generate a heap dump, I observe a significant drop in memory usage, returning to the initially expected levels. When i analyze the dump i dont see anything unusual because probably dump is generated with garbage collecetd memory. As i know this drop occurs because generating a heap dump triggers the garbage collector to work.


To test this behavior, I tried calling System.gc(), and it reproduced the memory drop. I'm curious about why this happens. Why does JVM not perform this garbage collection automatically? It appears that, for some reason, it doesn't do so without me explicitly forcing it to clear. But as i mentioned this does not cause JVM crash. Probably it releases that memory when it needs it. This is an autoscaling application running on Kubernetes, and this behavior results in the unnecessary creation of additional instances due to the memory increase.


Is there a parameter which i can pass to JVM related to this behaviour?


I expect JVM to clear memory automaticly without me explicitly calling System.gc()
7 months ago
First i have a java Date object lets say


with using this code i convert it to dd/MM/yyyy  format
 

 

But since sdf.format is returning to a string,after formating 1 time i cant format it again to my desired Monthname day,Year format  before displaying to user.

i mean if `sdf.format(firstdate)` returns "01/01/2000" string,i would like to convert this to January 1,2000   and then display it to user.


6 years ago
This code compares 2 objects and informs user about time conflicts:



It compares registeredcourseobject and coursestoregisterobject for time conflicts. The problem is script is buggy especially when registeredcourseobject is null or its not working properly when comparing elements of coursestoregisterobject.

example failure:

another example failure:

Tim Cooke wrote:So you need to implement the add() method that takes two Account objects and returns a single Account object. The implementation of that will depend on what you consider a 'combined' record to be.



somehow i need to manage this operation:


 
6 years ago
Lets say that we have a map like this:

private HashMap<Integer, Account> map;
Map has 2 object inside with key:1 and key:2

what i want to do is add values of key2 to key1 and remove key2. So they are combined.

 



6 years ago
I forgot to post Bank.class :
6 years ago
Main Class:


When i print whole bank i cant see objects content it just prints : asd.qwe.valuable.Gold@60f82f98      like this

Gold.class:

Dollar.class

Currency.class

Valuable.class
6 years ago

Carey Brown wrote:
Requires that your PersonDate (I renamed it, don't use Date) class has a constructor that takes a single String and then parses it to construct the object.


Hi thanks for the answer this is what i did:
Main:





After coming to comparing 2 objects i got confused.For example if o1.getyear is > o2.getyear put o1 up in list if they are equal check for month if they are equal check for day ...
6 years ago
Lets say that we have a text file like this:
Bob 1992-2-20
Cindy 1994-1-10
Dave 1991-4-12
Eddy 2000-4-4
Alex 1990-3-22
Fred 1991-3-12

what i am trying to do is produce a list in descending order with using a Date and DateComparator  classes (using collection.sort)

2000-4-4 Eddy
1994-1-10 Cindy
1992-2-20 Bob
1991-4-12 Dave
1991-3-12 Fred
1990-3-22 Alex

what i couldnt really understand is after reading txt file how do i put them in correct way into arraylist as Date object ??



DateComparator:


Date:

6 years ago
For example  i have an object with key 1:


i have another object with same key 1:

   

By iterating we check if both keys are matching ( in this case 1 and 1 ) so we add second objects A to first object as grade:A so final object looks like


I am adding a picture to explain better.


this is what i have tried: the problem is 00001 key is missing:

I am trying to run some code piece when progressbar status reaches 100.(in this case diggingStatus) But for some reason Log.d code is called 2 times not 1 time.I guess my if(diggingStatus==100) condition is in wrong place.

6 years ago

Norm Radder wrote:Why does line 22 create a new variable with the name of an existing variable?



I was planning to create marker hashmap and add them to it.nvm it
googleMap.addMarker(otherplayermarkeroptions);
alone is same i guess
6 years ago
I am pulling marker data from db and placing them on map.What i am trying to do is updating their positions on map when it is changed. Code below is doing its job for when there is 1 marker.I know its wrong for multiple markers.What should i do for multiple markers ?

6 years ago
I am pulling marker(relic) data from firebase database then adding them to map. Also i am adding them to another hashmap for doing distance calculations with current user location.Then i calculate closest marker to user and display how far player is to that selected closest marker.When user is closer than 10 meters to marker he can remove that marker from the map.

The problem is i can remove marker from map but whenever i call db removal code somehow db listener triggers and adds Nonexistent removed marker to the map.


By the way remove db code is working.Its removing data from database succesfully.

Here there is a video of unexpected behaviour: https://streamable.com/m7e90
6 years ago