How can I free up the memory in Selenium project ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I free up the memory in Selenium project ?

Abhishek
Hello All,

This is my first post in this forum and before that I would like to thank Tarun and appreciate him and all others for their contribution.
I am new to java programming and following these tutorials to learn selenium

I want to know how to free up the memory in selenium project so as to avoid 'Out of memory errors' in future.

for e.g.  
This is my test where I have instantiated 3 classes.
There would be many instances in entire project. Do I need to use garbage collector for it. If Yes, how?

@Test(priority=2,dataProvider="Delete user account")
        public void deleteUserAccount(String username,String password, String firstname1){
               
        Registration UOG = new Registration (driver);
        BrowseListOfUsers userlist = new BrowseListOfUsers(driver);
        DeleteUser deleteuser = new DeleteUser(driver);


                driver.get("http://localhost:8080/");
                UOG.clickDemoCourse();
                UOG_login.userLogin(username, password);
                UOG.navigateToUsersList();
                userlist.deleteUser(firstname1);
                deleteuser.clickContinue();
        }

Thanks,
Abhishek
Reply | Threaded
Open this post in threaded view
|

Re: How can I free up the memory in Selenium project ?

softwaretestingforum
Administrator
hm you may never have to force garbage collection from your program.
Is you system devoid of resources when running test? Do you always encounter this error or only at times?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: How can I free up the memory in Selenium project ?

Abhishek
Hi,

Thanks for a quick reply.

I have not encountered such problem as such and neither my system is devoid of resources.
It was asked to me in one of an interview by a person who was a system architect.
He might have asked this from a design and reliability perspective, but I am still looking for a convincing answer.